8

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
Community
  • 1
  • 1
  • 3
    ws works like a charm, easy to use, easy to understand, easy to... all. socket.io is a bloated software, don't use it. If the browser doesn't support websockets, then it's their fault, UPDGRADE the FU**NG browser!! – Gabriel Llamas May 16 '13 at 21:44
  • 1
    @Gabriel so which one out this listing http://stackoverflow.com/a/16393046/130638 would you actually suggest and why? The issue is more with the diversity of choice, and no in-depth comparisons between which ones we should actually use. – balupton Jun 18 '13 at 02:46
  • I've been using [ws](https://github.com/einaros/ws) without any problem. In fact, socket.io uses ws to implement websockets. – Gabriel Llamas Jun 18 '13 at 08:56

1 Answers1

3

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