Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port mapping? #14

Closed
james-lawrence opened this issue Feb 5, 2017 · 3 comments
Closed

port mapping? #14

james-lawrence opened this issue Feb 5, 2017 · 3 comments

Comments

@james-lawrence
Copy link

I was wondering if this library supports port mapping? not too familiar with upnp but I'm basically just looking for the ability to setup an open port through the router. I tried searching for urn:schemas-upnp-org:service:WANIPConnection:1 and couldn't find any references but not sure if I'm ever searching for the right thing =)

@huin
Copy link
Owner

huin commented Feb 5, 2017

I wouldn't count myself an expert on UPnP. From my limited understanding, there are facilities to add port mappings in IGD1 and IGD2 (Intenet Gateway Device):

IGD1:
https://godoc.org/github.com/huin/goupnp/dcps/internetgateway1#WANIPConnection1.AddPortMapping
https://godoc.org/github.com/huin/goupnp/dcps/internetgateway1#WANPPPConnection1.AddPortMapping

IGD2:
https://godoc.org/github.com/huin/goupnp/dcps/internetgateway2#WANIPConnection1.AddPortMapping
https://godoc.org/github.com/huin/goupnp/dcps/internetgateway2#WANIPConnection2.AddPortMapping
https://godoc.org/github.com/huin/goupnp/dcps/internetgateway2#WANPPPConnection1.AddPortMapping

I think it depends which of those is supported by the UPnP device in question -- and its configuration. You might need to try all of them. The last router I tried this on supported IGD1 and WANPPP, if I remember correctly.

@james-lawrence
Copy link
Author

Yeah I went through each other and found the one that worked. (also happens that my router had it disabled by default) thanks. =)

@huin
Copy link
Owner

huin commented Feb 5, 2017

Excellent, glad that's working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants