Node.js WebSocket Server compatible with Chrome 14+ and Safari?

I used the node.js WebSocket implementation from http://github.com/ncr/node.ws.js , but it is only compatible with the hixie-76 version of the protocol implemented by Safari 5.0.1.

I also need to work with Chrome, which now implements the official protocol on RFC 6455 .

Does anyone know a server side implementation for node.js that is compatible with both hixie-76 and hybi-17 (aka "version 13")?

Using Socket.IO is not recommended - these are not real websites!

The implementations that I know of do not work (at the time of writing):

+4
source share
2 answers

Since this question arose yesterday, I spent a bit of time supporting hixie-76 support (although I would prefer to stick only to hybi) in ws.

See if version 0.4.2 is available through npm or https://github.com/einaros/ws .

+1
source

You can try this library: https://github.com/wcauchois/websocket-fallback

It uses the Worlize / WebSocket-Node for browsers that implement newer versions of the protocol, and miksago / node -websocket-server for older browsers (Safari, I look at you!)

You just use one API and transparently deal with different browsers / connections / libraries for you.

0
source

Source: https://habr.com/ru/post/1394009/


All Articles