fd / go-nat Goto Github PK
View Code? Open in Web Editor NEWNAT port mapping library for Go
License: Apache License 2.0
NAT port mapping library for Go
License: Apache License 2.0
Currently, the code only runs NAT-PMP on local addresses in the ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
However, NAT-PMP/PCP can also be used for simple control of a stateful firewall, even when using public IPv4 or IPv6. See https://tools.ietf.org/html/rfc6887
Additionally, some people are beginning to use other ranges as "private" ranges: either unallocated network ranges (which is a very bad idea, but some people still do that), or the 100.64.0.0/10 range allocated to CG-NAT by https://tools.ietf.org/html/rfc6598
Does this lib support Port Control Protocol? I feel like you may have commented on an issue in go-ipfs saying that it did (or someone else did) but i can't see in the code where/how that happens.
While not critical, it would be nice if this library supported multiple interfaces/addresses on the same NAT. This would mean:
GetInternalAddress()
to GetInternalAddresses()
(or adding a new function) that exposes all internal addresses on the NAT.Use-cases:
I understand you probably don't have time to work on this, I just figured I'd leave this here in case anyone comes along and does.
Currently, the code takes the assumption that the gateway is always the first IP address of the network range: https://github.com/fd/go-nat/blob/master/natpmp.go#L37
But this is not always the case, see ipfs/kubo#1090
Note that it would be better if the underlying lib found that itself: jackpal/go-nat-pmp#1
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.