• A WebSocket is a bi-directional, message-based data transport that can be used in the browser.
  • It is a very simple protocol, basically a thin wrapper over TCP. Can be implemented in one day.
  • There is not much overhead compared to other protocols, the message framing is very small.

The WebSocket protocol is described by RFC 6455.

URLs

The URL for a WebSocket server can be specified as follows.

  • wss://example.com/ws for connections over TLS
  • ws://example.com/ws for non-TLS connections