Home »

What are web sockets?

Question ListCategory: HTMLWhat are web sockets?
jeanderson295 author asked 2 years ago
1 Answers
shah_kajal184 author answered 2 years ago

Web Sockets may be a next-generation two-way communication technology for internet
applications that operates over one socket and is exposed via a JavaScript interface in hypertext
mark-up language five compliant browsers.
Once you get an internet Socket reference to the online server, you’ll be able to send information
from browser to server by calling a send() method, and receive information from server to browser
by an onmessage event handler.
Following is that the API that creates a brand new WebSocket object.
var Socket = new WebSocket(URL, [PROTOCOL] );
Here 1st argument, url, specifies the universal resource locator to that to attach. The second
attribute, protocol is optional , and if present, specifies a sub-protocol that the server should
support for the affiliation to achieve success.

Please login or Register to Submit Answer