Which websocket library to use with Node.js? -


currently there plethora of websocket libraries node.js, popular seem be:

however can't find solid concrete comparisons between of them... apparently socket.io awesome, has become quite dated , has failing builds. both ws , websocket-node claim fastest. , engine.io seems new, lot heavier lighter aletarntives.

it amazing if or put answer serves guide on socket library use , when, comparison between them.

getting ball rolling community wiki answer. feel free edit me improvements.

  • ws websocket server , client node.js. 1 of fastest libraries if not fastest one.

  • websocket-node websocket server , client node.js

  • websocket-driver-node websocket server , client protocol parser node.js - used in faye-websocket-node

  • faye-websocket-node websocket server , client node.js - used in faye , sockjs

  • socket.io websocket server , client node.js + client browsers + (v0 has newest oldest fallbacks, v1 of socket.io uses engine.io) + channels - used in stack.io. client library tries reconnect upon disconnection.

  • sockjs websocket server , client node.js , others + client browsers + newest oldest fallbacks

  • faye websocket server , client node.js , others + client browsers + fallbacks + support other server-side languages

  • deepstream.io clusterable realtime server handles websockets & tcp connections , provides data-sync, pub/sub , request/response

  • socketcluster websocket server cluster makes use of cpu cores on machine. example, if use xlarge amazon ec2 instance 32 cores, able handle 32 times traffic on single instance.

  • primus provides common api of libraries above easy switching + stability improvements of them.

when use:

  • use basic websocket servers when want use native websocket implementations on clientside, beware of browser incompatabilities

  • use fallback libraries when care browser fallbacks

  • use full featured libraries when care channels

  • use primus when have no idea use, not in mood rewriting application when need switch frameworks because of changing project requirements or need additional connection stability.


Comments