Added commandline arguments and functionality usefull to run behind a NAT#7
Added commandline arguments and functionality usefull to run behind a NAT#7pvagner wants to merge 1 commit intochatmail:mainfrom
Conversation
hpk42
left a comment
There was a problem hiding this comment.
i think it makes sense to support manual tweaking, but don't like the multitude of new options. What about
--net "listen=192.168.1.10:3478,external=203.0.113.7,relay-ports=49152-65535"
which would disable auto-discovery, and you need to provide all neccessary settings in the --net directive?
also, some addition to README.md is needed, not just a code change.
|
@hpk42 Thanks for looking into it. These days I can't work on it further but hopefully I will figure it out sooner rather than later. Greetings Peter |
|
@hpk42 |
|
Also, for convenience, we can allow specifying only port(s), without an IP, like this: which defaults to the all-zero host for the listen address and an automatic IP detection for the relay address. |
|
Would you mind if i send a PR? |
|
@DarkCat09 It would be awesome if you can make a PR that supersedes this one. Thanks for thinking about it and working more on it. |
This turn server enumerates all the interfaces found on the system, identifies globally addressable addresses and creates an UDP listen socket on the default port. Relay connections for this scenario is not restricted and the whole port range should be allowed in the firewall. This setup will work when the public addresses are configured on the system. For home setups where the server is behind a NAT this won't work.
There fore I have added ability to specify local listen address and a public relay address for listening connections and additional minimum and maximum port for the relay connections. Both the listen port and the relay port range have to be forwarded in the gateway providing network address translation so incoming UDP connections will end up reaching running instance of this turn server.
While testing run
to discover the commandline arguments.