WebSocket Runs Over TCP | Generated by AI

Home 2026.03

Question: Is WebSocket built on UDP?

Answer:

No, WebSocket is not built on UDP.

WebSocket is built on top of TCP, just like HTTP.

Here is the actual protocol stack:

Application → WebSocket (ws:// or wss://)
              ↓
Transport     → TCP
              ↓
Internet      → IP

Typical full stack comparison:

Protocol Transport layer Reliable? Ordered? Common use cases
WebSocket TCP Yes Yes Real-time apps, chat, games, trading
HTTP/1.1 TCP Yes Yes Web pages, APIs
HTTP/2, HTTP/3 TCP (h2) / UDP (h3) Yes Yes Faster web, multiplexing
WebRTC data UDP (SCTP over DTLS over UDP) No* No* Video calls, file transfer in browsers
Raw UDP UDP No No DNS, gaming, VoIP, streaming

*WebRTC data channel provides optional reliability & ordering via SCTP, but it still runs over UDP.

Quick summary – why WebSocket uses TCP (not UDP)

UDP-based alternatives (used when you explicitly want lower latency and can tolerate loss):

Bottom line (2026):

WebSocket = TCP
WebSocket ≠ UDP

References:


Back Donate