Comments (7)
Using the interface of the default 0.0.0.0 route would be good too. In my case (Windows) it is not using the interface of the default route, but another.
from goupnp.
Sorry for the (very) delayed reply, and thanks for diagnosing this.
I've created the multi-interface
branch to provide a possible solution along the lines of your first suggestion. Could you try that out and see if that resolves your issue?
from goupnp.
I faced same issue, that with 1 interface all is fine.
Having 2 interfaces to different networks does not work, goupnp.DiscoverDevices("ssdp:all") does not return any results.
I've tested the multi-interface
branch. When using it even with only 1 interface I do not get any results. Same for multiple interfaces.
from goupnp.
I faced same issue, that with 1 interface all is fine.
Having 2 interfaces to different networks does not work, goupnp.DiscoverDevices("ssdp:all") does not return any results.I've tested the
multi-interface
branch. When using it even with only 1 interface I do not get any results. Same for multiple interfaces.
Did the library work for you on the master
or devel
branch? It's not clear to me if you're describing a regression on the multi-interface
branch or if it's a potential problem with the library as a whole.
Also, do you expect network devices to respond on your network? Note that this library only supports IPv4. You might want to try performing packet captures or other UPnP clients to see if they work. A big problem with this library is that I only have my own home network to test on, and everyone's network and computer configurations are different. Reproducing problems is key to fixing any bugs.
I've also written a command on the devel
branch called discoverall
which should print out anything that it finds. I've merged that into the multi-interface
branch as well, which should be useful for comparison.
Obviously don't share any private information on this bug.
from goupnp.
Did the library work for you on the master or devel branch? It's not clear to me if you're describing a regression on the multi-interface branch or if it's a potential problem with the library as a whole.
Sorry for not being precise enough.
The working application used require github.com/huin/goupnp v1.0.0
which AFAI see is the master
. The library in whole did work very well, as long as only connected via 1 interface. Thanks for sharing your code BTW !!!
When testing the multi-interface
branch, go mod tidy
resolved on 2020-05-14
require github.com/huin/goupnp multi-interface
to
require github.com/huin/goupnp v1.0.1-0.20200510113636-70bc05ba64ba
Also, do you expect network devices to respond on your network? Note that this library only supports IPv4. You might want to try performing packet captures or other UPnP clients to see if they work.
Yes: I have IPv4 and IPv6 running in network, but I am aware that only IPv4 is supported. I am using >10 UPnP devices inside network (for business needs), different types of routers, TVs, NASs, and many more.
I am using other UPnP clients as well (all on macOS, gupnp, UPnPAnalyzer, Java UPnP tools), so I can compare behavior, and can obseve network traffic as well (UPnPAnalyzer, wireshark).
A big problem with this library is that I only have my own home network to test on, and everyone's network and computer configurations are different. Reproducing problems is key to fixing any bugs.
I understand this problem very good, as I maintain a Java UPnP tool from time to time (https://github.com/jupnp/jupnp/tree/master/tools/org.jupnp.tool) and you have to fiddle around with a lot of non-compliant behavior due to "broken" UPnP devices. So you need other peoples help to check problems with THEIR devices in case of troubleshooting.
I've also written a command on the devel branch called discoverall which should print out anything that it finds. I've merged that into the multi-interface branch as well, which should be useful for comparison.
Thanks a lot, I will give it a testing next days. I'll keep you updated here.
from goupnp.
I gave the branch multi-interface
a test in my network environment.
On first test discoverall
reported
2020/05/25 14:10:27 write udp 127.0.0.1:58394->239.255.255.250:1900: sendto: can't assign requested address
Why will be the loopback IP be used? I assumed thats wrong.
After applying a small fix discoverall
did work well from a first testing, finding UPnP devices on all connected networks:
File network.go
, func localIPv4MCastAddrs
if addr.IP.To4() == nil {
// Not IPv4.
continue
}
// Fix: do NOT consider loopback IPs
if addr.IP.IsLoopback() {
// do not use local addrs
continue
}
addrs = append(addrs, addr.IP.String())
I will provide a PR for that.
from goupnp.
I've merged these commits into master
. Hopefully that resolves the issue. I'll close this issue, but please reopen it if the problem remains.
from goupnp.
Related Issues (20)
- Unable to find devices most of the time HOT 7
- It's not possible to query ssdp:all HOT 1
- Incorrect err (nil) returned incase of timeout in httpu HOT 6
- Discover UPnP as not active if UPnP not ON in device HOT 4
- Show devices connected to discovered UPnP enabled device. HOT 2
- Why can't i find this upnp device (http://192.168.61.1:5000/rootDesc.xml)? HOT 5
- GetTotalBytesSent() can't parse value, if it's negative HOT 3
- Fail on http post request to router. HOT 12
- Please provide example of AV dlna device implementation (audio) HOT 2
- Could you specify some examples? HOT 10
- Making charset dependency optional HOT 6
- SSDPRawSearch: With the same USN, ipv4Response was replaced by ipv6Response, which is not effected for ipv4only client. HOT 1
- Contexts on HTTP calls HOT 6
- httpu: error while parsing response HOT 4
- Any plan to add SSDP Server Support ? HOT 1
- get the IP associated with the interface used to successfully discover the upnp setup ? HOT 26
- feat: context everywhere and non-blocking results HOT 2
- update the guide HOT 1
- Provide an API to use specific ip addresses for discovery HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goupnp.