Code: Select all
var ws = new sockets.websocket( wsUrl );
ws.onopen = function ( e ) {
console.log( 'WebSocket opened @[' + wsUrl + ']' );
}
ws.onmessage = function ( e ) {...};
ws.send( someObj );
On the server I can see the connection request headers:
Now I need to add some extra headers upon handshake, but can't find any documentation on that.[Pragma=no-cache, Cache-Control=no-cache, Host=192.168.0.113:8822, Upgrade=websocket, Connection=Upgrade, Sec-WebSocket-Key=25p00PnBptREGXYdGcq9Dg==, Sec-WebSocket-Extensions=x-webkit-deflate-frame,deflate-frame, Sec-WebSocket-Version=13]
What's the best way to do it?