Jump to content

Socket.IO

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Nobelium (talk | contribs) at 09:08, 22 August 2018 (→‎Overview: interwikify Comet). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Socket.IO
Original author(s)Guillermo Rauch
Developer(s)Automattic
Stable release
2.1.1 / May 23, 2018 (2018-05-23)[1]
Repository
Written inJavaScript
Operating systemCross-platform
TypeEvent-driven networking
LicenseMIT License[2]
Websitesocket.io

Socket.IO is a JavaScript library for realtime web applications. It enables realtime, bi-directional communication between web clients and servers. It has 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. Like Node.js, it is event-driven.

Socket.IO primarily uses the WebSocket protocol with polling as a fallback option,[3] while providing the same interface. Although it can be used as simply a wrapper for WebSocket, 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 npm tool.[4][5]

Overview

Socket.IO provides the ability to implement real-time analytics, binary streaming, instant messaging, and document collaboration.[6] Notable users include Microsoft Office, Yammer, and Zendesk.[7]

Socket.IO handles the connection transparently. It will automatically upgrade to WebSocket if possible. This requires the programmer to only have Socket.IO knowledge.

Socket.IO is not a WebSocket library with fallback options to other realtime protocols. It is a custom realtime transport protocol implementation on top of other realtime protocols. Its protocol negotiation parts cause a client supporting standard WebSocket to not be able to contact a Socket.IO server. And a Socket.IO implementing client cannot talk to a non-Socket.IO based WebSocket or Long Polling Comet server. Therefore, 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.[8]

References

  1. ^ "Release 2.1.3 · socketio/socket.io". GitHub.
  2. ^ "socket.io/LICENSE at master · socketio/socket.io · GitHub". GitHub.
  3. ^ "socketio/engine.io". GitHub.
  4. ^ "socket.io". npmjs.org.
  5. ^ "faq - npm Documentation". npmjs.com. Archived from the original on 2015-11-25. {{cite web}}: Unknown parameter |deadurl= ignored (|url-status= suggested) (help)
  6. ^ socket.io
  7. ^ Paul Krill (2 June 2014). "Socket.IO JavaScript framework ready for real-time apps". InfoWorld.
  8. ^ Damien Arrachequesne (13 May 2017). "Socket.IO 2.0.0 release post".