Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is better: WebSocket-Node or ws? And is there a standard interface for nodejs websockets?

I want to move away from socket.io to regular websockets to take advantage of the binary data transfers and get rid of the base64 encoding.

There seem to be two main websocket libraries for nodejs, both are on github:

  1. Worlize/WebSocket-Node
  2. einaros/ws

Both seem to be getting regular updates, both claim to be supporting the RFC-6455 standard.

Does anyone have experience with either or both of these who can share experience and/or make recommendations? Or does anyone know where I can find a recent comparison of them?

Further are there any plans for an official server side Websocket interface standard? These two libraries seem to have different API's. I did find this, but it is clearly for the client side only, and significantly newer than the date on the RFC standard.

I have been looking through every variation of Google search I can think of, and many related StackOverflow questions, but none seem to answer my question, and even the top Google results on the subject are several years out of date. Some related but insufficient StackOverflow threads include:

  1. which-websocket-library-to-use-with-node-js
  2. are-websockets-really-meant-to-be-handled-by-web-servers
  3. web-sockets-server-side-implementation-for-nodejs
like image 810
jeremykentbgross Avatar asked May 16 '13 19:05

jeremykentbgross


1 Answers

einaros/ws works great. However, Websocket-Node comes with routing support, which is quite handy for non-trivial implementations.

like image 190
Manuel Santillan Avatar answered Sep 27 '22 19:09

Manuel Santillan