Realtime application framework (Node.JS server)
Alternatives To
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Socket.io58,335228,9999,6155 days ago144September 02, 2022121mitTypeScript
Realtime application framework (Node.JS server)
4 months ago21April 12, 202143bsd-2-clauseGo
Turn any program that uses STDIN/STDOUT into a WebSocket server. Like inetd, but for WebSockets.
7 days agoFebruary 08, 202164apache-2.0Swift
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
Java Websocket9,6601,2061972 months ago13April 09, 202248mitJava
A barebones WebSocket client and server implementation written in 100% Java.
Server8,77318 days ago50September 10, 202243otherGo
A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)
Sockjs Client8,208305,14981512 days ago32May 28, 202215mitJavaScript
WebSocket emulation - Javascript client
Androidasync7,308285226 months ago65November 08, 2020351otherJava
Asynchronous socket, http(s) (client+server) and websocket library for android. Based on nio, not threads.
4 days ago2May 01, 202122apache-2.0Elixir
Broadcast, Presence, and Postgres Changes via WebSockets
2 years ago145mitPython
Fast, asynchronous and elegant Python web framework.
Engine.io4,508163,3422635 days ago133June 06, 202215mitJavaScript
The engine used in the Socket.IO JavaScript server, which manages the low-level transports such as HTTP long-polling and WebSocket.
Alternatives To
Select To Compare

Alternative Project Comparisons

Run on Backers on Open Collective Sponsors on Open Collective Build Status NPM version Downloads


Socket.IO enables real-time bidirectional event-based communication. It consists of:

Some implementations in other languages are also available:

Its main features are:


Connections are established even in the presence of:

  • proxies and load balancers.
  • personal firewall and antivirus software.

For this purpose, it relies on Engine.IO, which first establishes a long-polling connection, then tries to upgrade to better transports that are "tested" on the side, like WebSocket. Please see the Goals section for more information.

Auto-reconnection support

Unless instructed otherwise a disconnected client will try to reconnect forever, until the server is available again. Please see the available reconnection options here.

Disconnection detection

A heartbeat mechanism is implemented at the Engine.IO level, allowing both the server and the client to know when the other one is not responding anymore.

That functionality is achieved with timers set on both the server and the client, with timeout values (the pingInterval and pingTimeout parameters) shared during the connection handshake. Those timers require any subsequent client calls to be directed to the same server, hence the sticky-session requirement when using multiples nodes.

Binary support

Any serializable data structures can be emitted, including:

Simple and convenient API

Sample code:

io.on('connection', socket => {
  socket.emit('request', /*  */); // emit an event to the socket
  io.emit('broadcast', /*  */); // emit an event to all connected sockets
  socket.on('reply', () => { /*  */ }); // listen to the event


Browser support is tested in Sauce Labs:

Sauce Test Status

Multiplexing support

In order to create separation of concerns within your application (for example per module, or based on permissions), Socket.IO allows you to create several Namespaces, which will act as separate communication channels but will share the same underlying connection.

Room support

Within each Namespace, you can define arbitrary channels, called Rooms, that sockets can join and leave. You can then broadcast to any given room, reaching every socket that has joined it.

This is a useful feature to send notifications to a group of users, or to a given user connected on several devices for example.

Note: Socket.IO is not a WebSocket implementation. Although Socket.IO indeed uses WebSocket as a transport when possible, it adds some metadata to each packet: the packet type, the namespace and the ack id when a message acknowledgement is needed. That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a WebSocket server (like ws:// either. Please see the protocol specification here.


// with npm
npm install

// with yarn
yarn add

How to use

The following example attaches to a plain Node.JS HTTP server listening on port 3000.

const server = require('http').createServer();
const io = require('')(server);
io.on('connection', client => {
  client.on('event', data => { /*  */ });
  client.on('disconnect', () => { /*  */ });


const io = require('')();
io.on('connection', client => { ... });

Module syntax

import { Server } from "";
const io = new Server(server);

In conjunction with Express

Starting with 3.0, express applications have become request handler functions that you pass to http or http Server instances. You need to pass the Server to, not the express application function. Also make sure to call .listen on the server, not the app.

const app = require('express')();
const server = require('http').createServer(app);
const io = require('')(server);
io.on('connection', () => { /*  */ });

In conjunction with Koa

Like Express.JS, Koa works by exposing an application as a request handler function, but only by calling the callback method.

const app = require('koa')();
const server = require('http').createServer(app.callback());
const io = require('')(server);
io.on('connection', () => { /*  */ });

In conjunction with Fastify

To integrate in your Fastify application you just need to register plugin. It will create a decorator called io.

const app = require('fastify')();
app.register(require(''));'connection', () => { /*  */ });


Please see the documentation here.

The source code of the website can be found here. Contributions are welcome!

Debug / logging

Socket.IO is powered by debug. In order to see all the debug output, run your app with the environment variable DEBUG including the desired scope.

To see the output from all of Socket.IO's debugging scopes you can use:* node myapp


npm test

This runs the gulp task test. By default the test will be run with the source code in lib directory.

Set the environmental variable TEST_VERSION to compat to test the transpiled es5-compat version of the code.

The gulp task test will always transpile the source code into es5 and export to dist first before running the test.


Support us with a monthly donation and help us continue our activities. [Become a backer]


Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]



Popular Server Projects
Popular Websocket Projects
Popular Networking Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Socket Io