Subprotocols

Client sends: Sec-WebSocket-Protocol: mqtt, stomp, custom.v1. Server picks one or none.

Advertisement

Well-known subprotocols

  • mqtt — MQTT over WebSocket for IoT.
  • stomp — simple messaging protocol.
  • graphql-ws — GraphQL subscriptions.
  • Custom yourapp.v1 — versioned app protocols.
Advertisement

Extensions — permessage-deflate

Compression per message. Client and server negotiate. Cuts bandwidth 60-80% for text messages. Trades CPU for bandwidth.