Tal
Tal

Reputation: 181

Communication between Javascript clients?

I want my website, written in JS, to allow its users to send messages directly to one another, without passing through my server. The server can be used initially to get the information required for setting such a connection between users (for example, getting users' IP address, and giving them to other specific users).

Is it possible to do something like this on a website? If so, what do I need in order to send/ receive those messages?

Upvotes: 1

Views: 114

Answers (2)

Jonas
Jonas

Reputation: 5149

httprelay.io requires no additional libraries and with the simple AJAX calls you can send data from browser to browser.

Upvotes: 1

Denys Séguret
Denys Séguret

Reputation: 382444

Yes that's possible, but it's a little complex to set up. You would use a RTCPeerConnection which is part of the set of technologies known as WebRTC.

HTML5Rocks tutorial

Note that although it's generally not too hard to set up a demo using Google stun servers (and your own server for the signaling), doing this at a large scale is harder.

Upvotes: 1

Related Questions