WebSocket is a new web technology that provides bidirectional communication between a client and server over a TCP connection. It aims to overcome limitations of Ajax techniques like long polling and streaming that used HTTP. The WebSocket API was standardized by the W3C and IETF and is supported in HTML5 browsers through native JavaScript. It enables new types of web applications by facilitating real-time data transfer and interactive experiences.
12. API
var ws = new WebSocket("ws://example.com/service");
ws.onopen = function() {
// Web Socket is connected. You can send data by send() method.
ws.send("message to send"); ....
};
ws.onmessage = function (evt) { var received_msg = evt.data; ... };
ws.onclose = function() { // websocket is closed. };
http://dev.w3.org/html5/websockets/
11 8 15
17. Google
Ian Hickson editor of HTML5 specification
Reducing kilobytes of data to 2 bytes…and reducing latency
from 150ms to 50ms is far more than marginal. In fact, these
two factors alone are enough to make WebSocket seriously
interesting to Google.
2 150ms
50ms
2
WebSocket Google
11 8 15