HTML and CSS Reference
the client to the server. A WebSocket server can also act as a WebSocket client. However,
with WebSocket, web clients like browsers cannot accept connections that they did not
initiate. Figure 3-3 shows WebSocket clients connected to a server, where either the client
or the server can send data at any time.
Figure 3-3. WebSocket clients connected to a server
WebSocket bridges the world of the Web and the world of the Internet (or more
specifically, TCP/IP). Asynchronous protocols that were not previously easy to use with
web applications can now easily communicate using WebSocket. Table 3-1 compares the
main areas of TCP, HTTP, and WebSocket.
Table 3-1. Comparison of TCP, HTTP, and WebSocket
IP address and port
Text and binary