12. Using the WebSocket Protocol from Other Specifications
Other specifications can reference the WebSocket Protocol to define their communication mechanisms.
Subprotocols
Specifications can define subprotocols on top of WebSocket:
Example: STOMP over WebSocket
Sec-WebSocket-Protocol: stomp
Extensions
Specifications can define WebSocket extensions:
Example: RFC 7692 (WebSocket Compression Extensions)
Best Practices
- Clearly specify subprotocol name
- Define message format
- Define error handling
- Consider security
Reference Links
- Previous Chapter: 11. IANA Considerations
- Next Chapter: 13. Acknowledgements