Jump to content

Socket.IO: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Update URL from https://github.com/Automattic/engine.io to https://github.com/socketio/engine.io
 
(44 intermediate revisions by 36 users not shown)
Line 1: Line 1:
{{Short description|Library for realtime web applications}}
{{Multiple issues|
{{primary sources|date=January 2016}}
{{advert|date=January 2016}}
{{third-party|date=January 2016}}
{{More citations needed|date=October 2013}}
}}

{{Infobox software
{{Infobox software
| name = Socket.IO
| name = Socket.IO
| logo = socket-io.svg
| logo = socket-io.svg
| logo upright = yes
| screenshot =
| screenshot =
| caption =
| caption =
Line 14: Line 9:
| developer = Automattic
| developer = Automattic
| released =
| released =
| latest release version = 2.3.0
| latest release version = 4.7.2
| latest release date = {{release date|2019|09|20}}<ref>{{cite web|url=https://github.com/socketio/socket.io/releases/tag/2.3.0|title=Release 2.3.0 · socketio/socket.io|work=GitHub}}</ref>
| latest release date = {{start date|2023|08|02}}<ref>
{{cite web
|url=https://github.com/socketio/socket.io/releases
|title=Releases · socketio/socket.io
|website=GitHub.com
|access-date = 12 March 2021
| status = Active
}}</ref>
| programming language = [[JavaScript]]
| programming language = [[JavaScript]]
| operating system = [[Cross-platform]]
| operating system = [[Cross-platform]]
| genre = [[Event-driven programming|Event-driven]] [[computer network programming|networking]]
| genre = [[Event-driven programming|Event-driven]] [[computer network programming|networking]]
| license = [[MIT License]]<ref>{{cite web|url=https://github.com/socketio/socket.io/blob/master/LICENSE|title=socket.io/LICENSE at master · socketio/socket.io · GitHub|work=GitHub}}</ref>
| license = [[MIT License]]<ref>{{cite web |url=https://github.com/socketio/socket.io/blob/master/LICENSE |title=socket.io/LICENSE at master · socketio/socket.io · GitHub |work=GitHub |date=20 January 2023}}</ref>
| website = {{URL|https://socket.io/}}
| website = {{Official URL}}
}}
}}


'''Socket.IO''' is a [[JavaScript]] library for realtime [[web application]]s. It enables realtime, bi-directional communication between web clients and servers. It has two parts: a [[client-side]] library that runs in the [[web browser|browser]], and a [[server-side]] library for [[Node.js]]. Both components have a nearly identical [[Application programming interface|API]]. Like [[Node.js]], it is [[Event-driven architecture|event-driven]].
'''Socket.IO''' is an [[event-driven architecture|event-driven]] library for real-time [[web application]]s. It enables real-time, bi-directional [[communication]] between [[web client]]s and servers.<ref>{{cite book |last=Prusty |first=Narayan |url=https://books.google.com/books?id=eJWqDQAAQBAJ&dq=%22Socket.IO%22+-wikipedia&pg=PA107 |title=Modern JavaScript Applications |date=2016-07-25 |publisher=Packt Publishing Ltd |isbn=978-1-78588-027-8 |pages=103 |language=en}}</ref> It consists of two components: a [[client (computing)|client]], and a [[server (Computing)|server]]. Both components have a nearly identical [[application programming interface|API]].


Socket.IO is also a protocol,<ref>{{cite web |url=https://github.com/socketio/socket.io-protocol |title=Socket.IO Protocol |website=GitHub |language=en |access-date=May 26, 2023}}</ref> where different complying implementations of the protocol can communicate with each other. The main implementation consists of two parts: a client that runs in the [[web browser|browser]] and a server for [[Node.js]]. Apart from the main implementation, there are multiple implementations, for example, the official [[Deno (software)|Deno (JavaScript)]], [[C%2B%2B|C++]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], and [[Swift (programming language)|Swift]] servers.
Socket.IO primarily uses the [[WebSocket]] protocol with polling as a fallback option,<ref>{{cite web|url=https://github.com/socketio/engine.io|title=socketio/engine.io|work=GitHub}}</ref> while providing the same interface. Although it can be used as simply a [[wrapper library|wrapper]] for WebSocket, it provides many more features, including broadcasting to multiple sockets, storing data associated with each client, and [[asynchronous I/O]].


Socket.IO primarily uses the [[WebSocket]] protocol with polling as a fallback option, while providing the same interface.<ref name=":0">{{cite book |last=Ihrig |first=Colin J. |url=https://books.google.com/books?id=FZcQAwAAQBAJ&dq=%22Socket.IO%22+-wikipedia&pg=PA213 |title=Pro Node.js for Developers |date=2014-01-18 |publisher=Apress |isbn=978-1-4302-5861-2 |pages=213 |language=en}}</ref> Although it can be used simply as a [[wrapper library|wrapper]] for WebSockets, it provides many additional features such as heartbeats and timeouts.<ref name=":0" />
It can be installed with the [[npm (software)|npm]] tool.<ref>{{cite web|url=https://npmjs.org/package/socket.io|title=socket.io|work=npmjs.org}}</ref><ref>{{cite web|url=https://docs.npmjs.com/misc/faq#if-npm-is-an-acronym-why-is-it-never-capitalized|title=faq - npm Documentation|work=npmjs.com|url-status=dead|archive-url=https://web.archive.org/web/20151125135410/https://docs.npmjs.com/misc/faq#if-npm-is-an-acronym-why-is-it-never-capitalized|archive-date=2015-11-25|df=}}</ref>


It can be installed with the [[npm]] (Node Package Manager).<ref>{{cite web |url=https://npmjs.org/package/socket.io |title=socket.io |work=npmjs.org |date=31 May 2023 }}</ref>
== Overview ==
Socket.IO provides the ability to implement real-time analytics, binary streaming, instant messaging, and document collaboration.<ref>socket.io</ref> Notable users include [[Microsoft Office]], [[Yammer]], and [[Zendesk]].<ref>{{cite web|url=http://www.infoworld.com/article/2607757/javascript/socket-io-javascript-framework-ready-for-real-time-apps.html|title=Socket.IO JavaScript framework ready for real-time apps|author=Paul Krill|date=2 June 2014|work=InfoWorld}}</ref>


== See also ==
Socket.IO handles the connection transparently. It will automatically upgrade to [[WebSocket]] if possible. This requires the programmer to only have Socket.IO knowledge.
{{Portal|Free and open-source software}}

* [[JavaScript framework]]
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.
* [[JavaScript library]]
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 (programming)|Comet]] server.
* [[SignalR]]
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.<ref>{{cite web|url=https://socket.io/blog/socket-io-2-0-0/|title=Socket.IO 2.0.0 release post|author=Damien Arrachequesne|date=13 May 2017}}</ref>


== References ==
== References ==
Line 45: Line 42:


== External links ==
== External links ==
* {{Official website}}
{{Portal|Free and open-source software}}

* {{Official website|http://socket.io/}}
* {{Github|socketio/socket.io}}
* {{Github|socketio/socket.io}}
* [https://gitconnected.com/learn/socket-io Socket.IO Tutorials]


[[Category:JavaScript libraries]]
[[Category:JavaScript libraries]]

Latest revision as of 04:27, 26 November 2024

Socket.IO
Original author(s)Guillermo Rauch
Developer(s)Automattic
Stable release
4.7.2 / August 2, 2023 (2023-08-02)[1]
Repository
Written inJavaScript
Operating systemCross-platform
TypeEvent-driven networking
LicenseMIT License[2]
Websitesocket.io Edit this at Wikidata

Socket.IO is an event-driven library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers.[3] It consists of two components: a client, and a server. Both components have a nearly identical API.

Socket.IO is also a protocol,[4] where different complying implementations of the protocol can communicate with each other. The main implementation consists of two parts: a client that runs in the browser and a server for Node.js. Apart from the main implementation, there are multiple implementations, for example, the official Deno (JavaScript), C++, Java, Python, and Swift servers.

Socket.IO primarily uses the WebSocket protocol with polling as a fallback option, while providing the same interface.[5] Although it can be used simply as a wrapper for WebSockets, it provides many additional features such as heartbeats and timeouts.[5]

It can be installed with the npm (Node Package Manager).[6]

See also

[edit]

References

[edit]
  1. ^ "Releases · socketio/socket.io". GitHub.com. Retrieved 12 March 2021.
  2. ^ "socket.io/LICENSE at master · socketio/socket.io · GitHub". GitHub. 20 January 2023.
  3. ^ Prusty, Narayan (2016-07-25). Modern JavaScript Applications. Packt Publishing Ltd. p. 103. ISBN 978-1-78588-027-8.
  4. ^ "Socket.IO Protocol". GitHub. Retrieved May 26, 2023.
  5. ^ a b Ihrig, Colin J. (2014-01-18). Pro Node.js for Developers. Apress. p. 213. ISBN 978-1-4302-5861-2.
  6. ^ "socket.io". npmjs.org. 31 May 2023.
[edit]