Skip to main content

Socket.IO

https://socket.io/

Bidirectional and low-latency communication for every platform

It's like a wrapper of WebSocket, making WebSocket and realtime communication much easier.

Supported Languages

Many languages are supported for both server and client, as of the date of writing, here is a list of supported languages.

Client Implementations

There are also several client implementation in other languages, which are maintained by the community:

Server Implementations

Socket.io is designed for Nodejs natively, so only Nodejs has official server implementation,

Java, C++ and Swift clients are also officially supported to accomodate Android, Desktop and Apple apps.

Important Notes and Docs

  • TypeScript Support
  • Unit Testing
  • Adapters for distributed systems
    • Replace in-memory adapter with database adapters when scaling to multiple Socket.IO servers
    • I've personally used Redis Adapter and it works fine
  • Socket.IO Cheatsheet
  • Concept of Room
    • Room concept allows users to
      • communicate with each other in a many to many way
      • broadcast to a group of users
      • etc.
    • It's an essential concept to understand
  • Concept of Namespaces
    • A Namespace is a communication channel that allows you to split the logic of your application over a single shared connection

Admin UI

Socket.IO provides an admin UI for monitoring and debugging purposes.

Docs: https://socket.io/blog/admin-ui-first-release/

Go to this website to get connected. https://admin.socket.io

Note on CORS

Setting CORS to "*" may not work. you may have to set origin: ["https://admin.socket.io"].