Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebUDP don't need a stun server and a signaling server? #6

Closed
lxlenovostar opened this issue Jan 3, 2018 · 5 comments
Closed

WebUDP don't need a stun server and a signaling server? #6

lxlenovostar opened this issue Jan 3, 2018 · 5 comments

Comments

@lxlenovostar
Copy link

I read the examples/EchoExamples.cpp, I can't find query a stun server and a signaling server.
If we want to P2P between WebUDP and chrome(js) in a network behind NAT, we should use a stun server and a signaing server.
I think WebUDP will install on the server and have a public IP, so we don't need stun server and signaling server. This is right?

Thank you.

@seemk
Copy link
Owner

seemk commented Jan 3, 2018

Yes, this is right, you don't need need external signalling or STUN. WebUDP is meant to have a public IP and it has built-in signalling and STUN. The default Linux C++ implementation (epoll) uses HTTP for signalling.

@lxlenovostar
Copy link
Author

lxlenovostar commented Jan 3, 2018

Do you have a plan which implement WebUDP can used in a network behind NAT? If WebUDP can achieve this function, a P2P network can build between WebUDP and chrome. In addition, we can
use WebUDP on Embedded equipment and Mobile devices.

Thank you.

@seemk
Copy link
Owner

seemk commented Jan 3, 2018

I think it is possible to run WebUDP behind a NAT, but you will need another coordinator server with a public address to do the UDP hole punching via STUN or some other method.
Basically:

  1. WebUDP registers with a coordinator server, the coordinator now knows WebUDP's public IP, port.
  2. Browser clients get WebUDP's server address from the coordinator.
  3. Browser clients initiate a connection to WebUDP

Keep in mind that the moment there is no client mode for WebUDP, it can't initiate a connection itself to other servers or browsers, but I've been thinking of adding that feature.

If you want to run it on mobile devices or embedded equipment, there's also an option to write your own host implementation using libWu (Wu.h). The default Linux C++ host uses HTTP over a TCP socket to exchange SDPs, but it is very much possible to use UDP for the SDP exchange as well (via a coordinator server, not directly from the browser), so you would only need to open an UDP port on the device.

@lxlenovostar
Copy link
Author

Do you have a TODO list? In this case, others can participate.

Thank you.

@seemk
Copy link
Owner

seemk commented Jan 4, 2018

It does now :) I added 2 issues with the "enhancement" label, these are the ones that have been in the back of my mind, but not important for myself.

#8
#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants