Easy WebSocket

like WebSocket but no server setup and available in any browser

EasyWebSocket aims to make realtimes webapps in every browser without the trouble to setup servers.

How to Use It

Include the following in your webpage and it just works.

    <script src="http://easywebsocket.org/easyWebSocket.min.js"></script>	
    <script>
        var socket = new EasyWebSocket("ws://example.com/resource");
        socket.onopen	= function(){
            socket.send("hello world!")
        }
        socket.onmessage= function(event){
            alert("received "+ event.data)
        }
    </script>

Step 1: You connect the socket to a given url

Step 2: What you send() thru this socket is sent to all sockets connected the same url

See this code live. No server setup, no cross-origin issue to care about... It is that easy!

Demo

Seeing it work is always nice. Here is a little chat application on top of EasyWebSocket. It is possible to monitor EasyWebSocket time efficiency.

Code

EasyWebSocket is written by Jerome Etienne. The code is available on github at EasyWebSocket under MIT license. The API is copied on the WebScocket standard API, thus compatible and easy to learn. I did a presentation for it.