1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
Ivan Kozlovic 603f0895f4
Add note to same_origin and allowed_origins
Clarify that these 2 options are used only for clients that present an Origin header, likely from web browsers.
2021-05-11 18:53:55 -06:00
..
2021-03-29 16:42:40 +00:00

WebSocket

Supported since NATS Server version 2.2

WebSocket support can be enabled in the server and may be used alongside the traditional TCP socket connections. TLS, compression and Origin Header checking are supported.

Important

  • NATS Supports only WebSocket data frames in Binary, not Text format [https://tools.ietf.org/html/rfc6455\#section-5.6](https://tools.ietf.org/html/rfc6455#section-5.6). The server will always send in Binary and your clients MUST send in Binary too.
  • For writers of client libraries: a WebSocket frame is not guaranteed to contain a full NATS protocol actually will generally not. Any data from a frame must be going through a parser that can handle partial protocols. See the protocol description here.