Socket.IO
Socket.IO is an event-driven library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers. It consists of two parts: a client-side library that runs in the browser, and a server-side library for Node.js. Both components have a nearly identical API.
![]() | |
Original author(s) | Guillermo Rauch |
---|---|
Developer(s) | Automattic |
Stable release | |
Repository | |
Written in | JavaScript |
Operating system | Cross-platform |
Type | Event-driven networking |
License | MIT License[2] |
Website | socket |
Socket.IO primarily uses the WebSocket protocol with polling as a fallback option,[3] while providing the same interface. Although it can be used simply as a wrapper for WebSockets, it provides many more features, including broadcasting to multiple sockets, storing data associated with each client, and asynchronous I/O.
It can be installed with the Node Package Manager (NPM).[4]
Overview
Socket.IO provides the ability to implement real-time analytics, binary streaming, instant messaging, and document collaboration.[5] Notable users include Microsoft Office, Yammer and Zendesk.[6]
Socket.IO handles the connection transparently and will automatically upgrade to WebSocket if possible. This means that the developer does not need to know how to use the WebSocket protocol in order to use Socket.IO.
Socket.IO is not a WebSocket library with fallback options to other real-time protocols. It is a custom real-time transport protocol implementation on top of other real-time protocols. A Socket.IO implementing server cannot connect to a non-Socket.IO WebSocket client. A Socket.IO implementing client cannot talk to a non-Socket.IO WebSocket or Long Polling Comet server. Socket.IO requires using the Socket.IO libraries on both client and server side.
As of version 2.0, Socket.IO makes use of WebSockets as the underlying WebSocket library.[7]
See also
References
- "Releases · socketio/socket.io". GitHub.com. Retrieved 12 March 2021.
- "socket.io/LICENSE at master · socketio/socket.io · GitHub". GitHub. 20 January 2023.
- "socketio/engine.io". GitHub. 17 January 2023.
- "socket.io". npmjs.org.
- socket.io
- Paul Krill (2 June 2014). "Socket.IO JavaScript framework ready for real-time apps". InfoWorld.
- Damien Arrachequesne (13 May 2017). "Socket.IO 2.0.0 release post".