Comments (8)
I really hope the whole "NAT traversal" feature is not mentioned in this repo. I should have removed all mention of it a long time ago. If any occurrence of the word "NAT traversal" is still present in this repo, I will remove all of it.
UDP hole punching is how NAT traversal works with this library. But beyond that, when it comes to NAT traversal, UDP hole punching does not generally work. It will work with full-cone and I think address-restricted-cone, but beyond that, UDP hole punching is either really difficult (read, impractical), or impossible.
from node-rudp.
Thanks for the response.
You mention NAT traversal on the npm page.
No really; that above code will actually work, even if all hosts were sitting behind a NAT. Give it a try. For the heck of it, give rudp a try with a file sharing example.
From my understanding. UDP hole punching works on the majority of routers. I read this in this paper; see section 6.2. This paper also says that a rendezvous server is required for hole punching to work. You say your module uses hole punching but I don't see where I point it to a rendezvous server. Am I missing something?
from node-rudp.
This paper also says that a rendezvous server is required for hole punching to work. You say your module uses hole punching but I don't see where I point it to a rendezvous server. Am I missing something?
Yes, a rendezvous server is very helpful (if not, it's a requirement). You send a packet to the server, the server now has access to an IP address and port number. When another host asks for the address:port of the host that they want to talk to, the server will respond with said address:port, and will also record the host's address:port.
Then each client may go ahead and ping each other at the address and port that they got.
from node-rudp.
And the use of a rendezvous is not implemented in this library.
from node-rudp.
Ok so what you're saying basically is that if I wanted to use your library to connect two UDP clients behind NAT routers I would need to write/host my own rendezvous server as well as implement the hole punching algorithm on top of the library?
from node-rudp.
Yes.
from node-rudp.
Ok. Thank you for taking the time to discuss with this me. I'm trying to create a p2p chat app to learn more about p2p networking and I've slowly been putting the pieces together in my mind. This has been very helpful.
from node-rudp.
If you look at my example code, you will notice that the rudp.Client
constructor expects a dgram
socket as its first parameter.
I did this specifically so that this library may be able to piggy-back off of another NAT-traversal handshake library. After the handshake, it may continue communicating using the reliable UDP protocol.
from node-rudp.
Related Issues (12)
- More specific working example HOT 6
- emit event on receipt of all packets in a "message"
- Server HOT 8
- buffertools HOT 2
- getting the remote info on message HOT 1
- getting corrupted data in one end point HOT 5
- msg not rebuild?
- PendingPacket keeps going after client.close()
- callback for send HOT 5
- Turn `rudp` into a streaming library HOT 3
- validate packets - not all may be meant for the client HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rudp.