node-stun | Session Traversal Utilities NAT client
kandi X-RAY | node-stun Summary
kandi X-RAY | node-stun Summary
Session Traversal Utilities for NAT (STUN) client for Node.js.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-stun
node-stun Key Features
node-stun Examples and Code Snippets
Community Discussions
Trending Discussions on node-stun
QUESTION
I'm attempting to set up a STUN server using STUN server for Node.js:
https://github.com/enobufs/stun
The readme has the following guidance:
Place a config file named as node-stun.ini in your current directory. The config file should look like following. (These local loopback addresses should be routable public IP addresses in the real settings, of course)
[primary] host = 127.0.0.1
[secondary] host = 127.0.0.2
Does anyone know what the primary and secondary IPs should be? Should the primary be the IP address of my STUN server machine? What should the secondary be?
Could I set them as localhost and route requests to the server with nginx?
Finally, why does the software need to refer to these IP addresses?
...ANSWER
Answered 2020-Nov-16 at 21:51Technically, STUN requires two unique public IP addresses on the server. But most client implementations only need one and don't use the alternate/secondary address. And the server code needs to know what these addresses are for two reasons:
So that the server knows which address to bind the sockets to. (It would need the local ip addresses for each)
So that the server can advertise the alternate IP address when a binding request hits the primary IP. (It needs to know the public IP addresses of the host if its behind a NAT with port forwarding).
If you don't have a secondary IP address to offer, then give in any address that allows the server to run. This will break STUN behavior and filtering tests, but rarely do clients need this.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-stun
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page