HTML and CSS Reference
In-Depth Information
Figure 3-5. Using Google Chrome Developer Tools to view a WebSocket session
We highly recommend using these tools to watch WebSockets in action, not only
to learn about protocols, but also to better understand what is happening during the
WebSocket session.
The WebSocket Protocol
Let's take a closer look at the WebSocket Protocol. For each part of the protocol, we will
look at JavaScript code to handle that particular syntax. Afterward, we will combine these
snippets into an example server library and two simple applications.
The WebSocket Opening Handshake
Every WebSocket connection begins with an HTTP request. This request is much like any
other, except that it includes a special header: Upgrade . The Upgrade header indicates that
the client would like to upgrade the connection to a different protocol. In this case, the
different protocol is WebSocket.
Search WWH ::

Custom Search