Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've built peer to peer app a while ago in QT and C, but I had to build the whole thing with a friend of mine. I'm wondering if it possible to build such an application in web browser. Is there an opensource lib, API or anything that could help me achieve that on a browser?

share|improve this question

closed as off-topic by gnat, MichaelT, Kilian Foth, amon, Bart van Ingen Schenau Dec 15 at 14:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, MichaelT, amon, Bart van Ingen Schenau
If this question can be reworded to fit the rules in the help center, please edit the question.

What do you mean "in a browser"? No server side code whatsoever? –  Morons Nov 30 '11 at 22:01
Well the HTML5 File API sounds like it would be helpful, but is only supported in a few browsers so far e.g. Firefox. –  Alex Hope O'Connor Nov 30 '11 at 23:21

3 Answers 3

Not really.

There are some browser specific things you can do (such as Opera Unite), but that limits you a lot.

Your best bet is to use a push technique with a centralized server (which you presumably already have as it is a webpage your serving). AJAX is your friend.

Alternatively you could develop a click-once style app in something like Java (Java Web Start) or .NET (XBAP). Be warned though, they both have down-sides compared with native web-apps.

Update: Kim B has mentioned the HTML5 WebSocket API as a possible solution.

This will not currently work for you as the section of the specification that deals with peer to peer communication (PeerConnection) is not currently implemented in browsers (Ericsson Labs is working on it though).

share|improve this answer
Thanks Dan, What about facebook video chat or google voice chat. I'm wondering how they did it inside a browser? –  Dorie Nov 30 '11 at 20:40
Facebook video chat uses a browser plug-in. See also: same way Flash works. –  Dan McGrath Nov 30 '11 at 20:45
Did you mean AJAX instead of AJAZ ? –  Raynos Nov 30 '11 at 21:22
@Devbag the only native p2p is in Chromium (highly experimental) and Opera (browser extension). –  Raynos Nov 30 '11 at 21:25
On a good day I do. Thanks Raynos. –  Dan McGrath Nov 30 '11 at 21:25

I believe that this can be done using Flash. Take a look at RTMFP.

share|improve this answer
Thanks all, That was really helpful. –  Dorie Nov 30 '11 at 22:11

Have a look into the WebSocket API. It's part of the HTML5 spec and is supported in most modern browsers.

share|improve this answer
I'm pretty sure that WebSockets only supports client-server connections. I don't think that it can be used to create peer to peer connections. –  jncraton Nov 30 '11 at 23:25
@Kim, see the update in my answer above. PeerConnection is not currently implemented in browsers. WebSockets will still only allow you to do client/server for the time being. –  Dan McGrath Nov 30 '11 at 23:30
Oh, and welcome to P.SE. It's good to see more of us Aussie's on here :) –  Dan McGrath Nov 30 '11 at 23:32
True, my bad. Until then you can use a service like Pusher or set up your own proxy, depending on the amount of traffic your app will be creating. P.S. thanks for the welcome :) –  Kim Burgess Nov 30 '11 at 23:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.