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?
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.
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).