I\'m trying to create some basic implementations of simple games (tic tac toe is the starting project) which can be played over the internet without requiring a central server.
In summary, if ajax can send a request to a specified IP and listen for a response.. why can't i get simple peer to peer messaging in pure js? Or can I?
It's due to the fact that an ajax request must be handled by an HTTP server so you still need to install a server to every clients.
say you want
I would say it is impossible to archive with all of these requirements except that you cut one of them off.
My suggestion is pubnub. This solution still need a server and it is not free(they have a free usage tier). But the good thing is you have an imitate p2p connection without doing server things and no client download needed.
After pubnub was recommended, I looked there and was partially impressed. However, I eventually stumbled across exactly what I was looking for UNBELIEVABLY. RTCDataChannel is the answer. This site finally showed that what I want is possible. The browser support for this functionality is small but growing and the entire ordeal has strengthened my faith in the growing support for peer to peer applications in the browser community.