The HTML5 WebSockets specification defines the API, which agrees that the Web uses a page websockets two-way communication with the remote host protocol.
Introduces the WebSocket interface and defines the full-duplex communication channel through the socket network. HTML5 WebSockets Instead of climbing the polling and long polling solution is used to simulate a full-duplex connection by maintaining two connections.
HTML5 WebSockets account agents and firewalls such as network hazards, so that streaming media can be in whatever connection, and can support upstream and downstream communication in a single connection, HTML5 websockets-based application Server to relieve the burden, Let the existing machine support many other concurrent connections. Shows a major websocket-based structure in which the browser uses a full-duplex websocket connection to communicate directly with the remote host.
A program typically uses a long polling base line to defend against firewalls and proxies.
Technology is effective, but not suitable for application sub-500 millisecond latency or high throughput requirements.
Plug-in technology, such as Adobe Flash, also provides some degree of support for sockets, but has been saddled with the problem of proxy and firewall traversal websockets today.
WebSocket detects that there is a proxy server, and that it proactively sets the tunnel through the proxy. A tunnel is established by issuing an HTTP connect statement to the proxy server, which requests the proxy server to open a TCP/IP connection to a specific host and port. Once the tunnel is established, communication can be unblocked through the agent flow. Because HTTP/S works in a similar way, SSL security websockets can take advantage of the same HTTP connection technology.
Note that WebSockets is only just beginning to be supported by modern browsers (Chrome now supports WebSockets local).
However, the implementation of backward compatibility enables today's browsers to take advantage of this emerging technology.
Other parts of the websockets-like HTML5 work, such as local storage and Geolocation-was as part of the original HTML 5 specification, were transferred to a single standard document specification concentrate.
WebSockets it has been submitted to the Internet Project Task Force (IETF) creator, Web Hypertext Application (WHATWG).
The author, the preacher and the enterprise participates in the standardization still to refer to the original function set, contains WebSockets, "HTML5." ”
HTML5 Analysis of actual combat websockets Basic introduction