If I understand you correctly, you want the clients to connect to you by the server and send messages to each other through ajax through the server. It is possible, there are two approaches for this.
An easy approach is for each client poll to check for new messages sent to others every few seconds. The disadvantage is that messages are not instantly delivered. I think this is an example found in the rails book .
, , . - Juggernaut
, , , , http, , , . rails chat, juggernaut.