onOpen

When the browser triggers the onOpen event for the websocket the event is dispatched to the onOpen event of the xsockets client.

<script>
    var conn = new xsockets.client('ws://localhost:4502');
    conn.onOpen = function(e){
      console.log('Connection Open', e);
    }
    conn.open();
</script>

The only thing that happen above is that the browser connects to the server and do a HTTP-upgrade to websockets. The handshake was then validated and a full-duplex connection was established. No actual frames has been sent/received just yet.

results matching ""

    No results matching ""