CS FundamentalsHardGATE CS · Product company CS fundamentals

How does a WebSocket connection start?

  1. A. As a separate UDP flow on port 81
  2. B. With an HTTP 200 response followed by a new TCP connection
  3. C. With a DNS SRV lookup and a TLS-only handshake
  4. D. As an HTTP Upgrade request answered by 101 Switching Protocols

Correct answer: D. As an HTTP Upgrade request answered by 101 Switching Protocols

The opening handshake reuses HTTP so it passes through ports 80/443 and proxies; the server proves it understood by returning Sec-WebSocket-Accept with 101. After that the connection is full-duplex message framing.

More Computer Networks questions

Exams that ask this topic