Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Client to Client Websockets

I am wondering whether it is possible for two clients to set up a websocket connection with each other, given that they have some help from the server to "locate" each other.

Currently there are messages going from a client to the server through websockets. The server simply redirects that msg to the client that needs to receive it, so I wondering if it is just possible to skip the middleman.

That is just having the server tell the two clients that need to communicate some info about one another so that they can start a websocket connect with each other. '

Is this possible? or are there some other possible issues with this

like image 381
JerryFox Avatar asked Jul 24 '14 20:07

JerryFox


1 Answers

This isn't possible through Web Sockets today. However, you can use WebRTC which has robust methods of establishing a peer to peer connection.

WebRTC is typically used for video conferencing applications, but a data channel is set up as well.

There is a lot to WebRTC. You can find an example here: http://www.html5rocks.com/en/tutorials/webrtc/datachannels/

like image 107
Brad Avatar answered Oct 04 '22 00:10

Brad