nebulouslabs / go-upnp Goto Github PK
View Code? Open in Web Editor NEWAn opinionated interface to your local Internet Gateway Device.
License: MIT License
An opinionated interface to your local Internet Gateway Device.
License: MIT License
--- FAIL: TestConcurrentUPNP (6.43s)
upnp_test.go:34: context canceled
...
upnp_test.go:34: context canceled
--- FAIL: TestIGD (3.13s)
upnp_test.go:55: Your external IP is: X.Y.Z.W
upnp_test.go:60: goupnp: error performing SOAP HTTP request: Post http://192.168.1.1:1900/upnp/control/WANIPConn1: EOF
FAIL
exit status 1
FAIL github.com/NebulousLabs/go-upnp 9.571s
ID | App Description | External Port | Protocol | Internal Port | IP Address | Status
1 | upnp test | 9001 | TCP | 9001 | 192.168.1.X | Enabled
We should clear the current port mapping before adding the new one. If an error is returned, it can be ignored.
The code compiles fine but when I run the exe it get stuck at Discover()
and then throws this error.
(0x7c4aa0,0xc04200c1d0)panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x465b89]
goroutine 1 [running]:
panic(0x6576e0, 0xc04200c090)
C:/Go/src/runtime/panic.go:500 +0x1af
github.com/NebulousLabs/go-upnp.(*IGD).ExternalIP(0x0, 0xc04200c1d0, 0xc04200c1d0, 0xc04207bf18, 0x4042e2)
C:/Users/Abdullah Saleem/Documents/GO/src/github.com/NebulousLabs/go-upnp/upnp.go:54 +0x29
main.main()
C:/Users/Abdullah Saleem/Documents/GO/Anonymizer/src/main.go:15 +0x6a
I have seen that this is intentionally an opinionated library.. :-) And https://github.com/NebulousLabs/go-upnp/blob/master/upnp.go#L14 states that the forwarding of a port is done for both TCP and UDP on purpose.
Anyway I would think it would be useful to be able to only forward the port for the protocol I need.
Would you accept a PR that adds the two methods ForwardTCP
and ForwardUDP
?
It would be nice to be able to check/retrieve the currently configured Port Forwardings/Mappings.
According to http://upnp.org/specs/gw/UPnP-gw-WANIPConnection-v1-Service.pdf there are two methods for this GetGenericPortMappingEntry
(iterate all existing forwardings) and GetSpecificPortMappingEntry
(limited to a set of ext IP, ext Port, Protocol).
Any chance this could be implemented? I would try to work on a PR but I have no experience with Go at all .. :-/
The link: https://godoc.org/github.com/NebulousLabs/upnp is 404
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.