I'm working with NodeJS and found this code that implements kind of native support for sockets since NodeJS doesn't supports sockets by default.
So I used the code to open a server(server is waiting...), now for the client side I used some simple html
file on my desktop with code like that, well at first glance it fail, but when I debug the code a bit I found out the the NodeJS socket code I found needs sec-websocket-key1
and sec-websocket-key2
while I get from the client-side code I implemented(in the plnkr) only sec-websocket-key
.
I looked that up and found that link that saying:
The first protocol used by HTML5 WebSockets was draft-ietf-hybi-thewebsocketprotocol-00 (HyBi 00). All was well until the protocol was upgraded to remedy some security issues. As a result of these changes, the Sec-WebSocket-Key1 and Sec-WebSocket-Key2 fields were added to the client header.
Basically that explains why I get sec-websocket-key
, I know that article also say that(according to caniuse) there only 2 browser supports the latest websockets protocol, I tested with chrome and firefox and both sends the same sec-websocket-key
...
- What is the true protocol I should support(is the right one), the one used
web-socket-key1/2
or justsec-websocket-key
- Which browsers supports(if those should be supported)
sec-websocket-key1
andsec-websocket-key2
? - Am I doing something entirely wrong with my client-side Web Sockets or the server side?
- Is there a shim to fix something?