HOME

TheInfoList



OR:

Socket.IO is an event-driven library for real-time
web application A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection. History In earlier computing models like client-serve ...
s. It enables real-time, bi-directional communication between web clients and servers. It consists of two parts: a
client-side Client-side refers to operations that are performed by the client in a client–server relationship in a computer network. General concepts Typically, a client is a computer application, such as a web browser, that runs on a user's local comp ...
library that runs in the browser, and a
server-side In the client–server model, server-side refers to programs and operations that run on the server. This is in contrast to client-side programs and operations which run on the client. General concepts Typically, a server is a computer applicati ...
library for
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code ou ...
. Both components have a nearly identical
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
. Socket.IO primarily uses the
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single Transmission Control Protocol, TCP connection. The WebSocket protocol was standardized by the Internet Engineering Task Force, IETF as in ...
protocol with polling as a fallback option, 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 In computer science, asynchronous I/O (also non-sequential I/O) is a form of input/output processing that permits other processing to continue before the transmission has finished. A name used for asynchronous I/O in the Windows API is overlap ...
. It can be installed with the Node Package Manager (NPM).


Overview

Socket.IO provides the ability to implement real-time analytics, binary streaming, instant messaging, and document collaboration. Notable users include
Microsoft Office Microsoft Office, or simply Office, is the former name of a family of client software, server software, and services developed by Microsoft. It was first announced by Bill Gates on August 1, 1988, at COMDEX in Las Vegas. Initially a ma ...
,
Yammer Yammer () is an enterprise social networking service that is part of the Microsoft 365 family of products. It is used mainly for private communication within organizations but is also used for networks spanning various organizations. Access to a ...
and
Zendesk Zendesk is an American company headquartered in San Francisco, California. It provides software-as-a-service products related to customer support, sales, and other customer communications. The company was founded in Copenhagen, Denmark, in 2007. ...
. Socket.IO handles the connection transparently and will automatically upgrade to
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single Transmission Control Protocol, TCP connection. The WebSocket protocol was standardized by the Internet Engineering Task Force, IETF as in ...
if possible. This means that the developer does not need to know how to use the
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single Transmission Control Protocol, TCP connection. The WebSocket protocol was standardized by the Internet Engineering Task Force, IETF as in ...
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 A comet is an icy, small Solar System body that, when passing close to the Sun, warms and begins to release gases, a process that is called outgassing. This produces a visible atmosphere or Coma (cometary), coma, and sometimes also a Comet ta ...
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.


See also

*
JavaScript framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build an ...
*
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. Libraries With the expanded demands for JavaScript, an e ...


References


External links

* * JavaScript libraries Free software programmed in JavaScript Software using the MIT license {{web-software-stub