Java Reference
In-Depth Information
then the server can ask the client to do an upgrade request. The server uses the 426 (up-
grade required) status code in such cases.
Note
The initial connection creation has some overhead (because of the HTTP frames that are
exchanged between the peers), but after it is completed, new messages have only 2 bytes
of additional headers. This means that when we have a large number of small messages,
WebSocket will be an order of magnitude faster than REST protocols simply because
there is less data to transmit!
If you are wondering about the browser support of WebSockets, you can look it up at ht-
tp://caniuse.com/websockets . All new versions of major browsers currently support We-
bSockets; the total coverage is estimated (at the time of writing) at 74 percent. You can
see this in the following screenshot:
Search WWH ::




Custom Search