From 6bacb945b4d00aed938befdb63146085d262e2ba Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Tue, 16 Feb 2021 10:29:41 -0700 Subject: [PATCH] Restructe layout, add README and config page, etc.. Resolves #205 Signed-off-by: Ivan Kozlovic --- SUMMARY.md | 2 +- nats-server/configuration/README.md | 1 + .../configuration/leafnodes/leafnode_conf.md | 2 +- nats-server/configuration/websocket/README.md | 12 ++++++++++++ .../websocket_conf.md} | 17 +++-------------- 5 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 nats-server/configuration/websocket/README.md rename nats-server/configuration/{websockets.md => websocket/websocket_conf.md} (86%) diff --git a/SUMMARY.md b/SUMMARY.md index f0eb82d..eb680a1 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -98,7 +98,7 @@ * [Monitoring](nats-server/configuration/monitoring.md) * [System Events](nats-server/configuration/sys_accounts/README.md) * [System Events & Decentralized JWT Tutorial](nats-server/configuration/sys_accounts/sys_accounts.md) - * [Websockets](nats-server/configuration/websockets.md) + * [Websocket](nats-server/configuration/websocket/README.md) * [Managing A NATS Server](nats-server/nats_admin/README.md) * [Upgrading a Cluster](nats-server/nats_admin/upgrading_cluster.md) * [Slow Consumers](nats-server/nats_admin/slow_consumers.md) diff --git a/nats-server/configuration/README.md b/nats-server/configuration/README.md index bbe1b84..214582c 100644 --- a/nats-server/configuration/README.md +++ b/nats-server/configuration/README.md @@ -117,6 +117,7 @@ authorization: { | [`cluster`](clustering/cluster_config.md) | Configuration map for [cluster](clustering/). | | | [`gateway`](gateways/gateway.md#gateway-configuration-block) | Configuration map for [gateway](gateways/). | | | [`leafnode`](leafnodes/leafnode_conf.md) | Configuration map for a [leafnode](leafnodes/). | | +| [`websocket`](websocket/websocket_conf.md) | Configuration map for [websocket](websocket/). | | ### Connection Timeouts diff --git a/nats-server/configuration/leafnodes/leafnode_conf.md b/nats-server/configuration/leafnodes/leafnode_conf.md index 6f7e5aa..f7ff7e2 100644 --- a/nats-server/configuration/leafnodes/leafnode_conf.md +++ b/nats-server/configuration/leafnodes/leafnode_conf.md @@ -118,7 +118,7 @@ Therefore this would be considered an invalid configuration: Note that the decision to make a TLS connection is not based on `wss://` (as opposed to `ws://`) but instead in the presence of a TLS configuration in the `leafnodes{}` or the specific remote configuration block. -To configure Websocket in the remote server, check the [Websocket](../websockets.md) secion. +To configure Websocket in the remote server, check the [Websocket](../websocket/websocket_conf.md) secion. ### `tls` Configuration Block diff --git a/nats-server/configuration/websocket/README.md b/nats-server/configuration/websocket/README.md new file mode 100644 index 0000000..2c17afa --- /dev/null +++ b/nats-server/configuration/websocket/README.md @@ -0,0 +1,12 @@ +# 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). 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](../../../nats-protocol/nats-protocol/README.md). diff --git a/nats-server/configuration/websockets.md b/nats-server/configuration/websocket/websocket_conf.md similarity index 86% rename from nats-server/configuration/websockets.md rename to nats-server/configuration/websocket/websocket_conf.md index 7e742d2..889fc00 100644 --- a/nats-server/configuration/websockets.md +++ b/nats-server/configuration/websocket/websocket_conf.md @@ -1,17 +1,6 @@ -# Websocket Support +# Configuration -*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). 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](../../nats-protocol/nats-protocol/README.md). - -To enable websocket support in the server, add a `websockets` configuration +To enable websocket support in the server, add a `websocket` configuration block in the server's configuration file like the following: ``` @@ -166,4 +155,4 @@ The possible values are currently: ## Leaf nodes connections You can configure remote Leaf node connections so that they connect to the Websocket port instead of the Leaf node port. -See [Leafnode](leafnodes/leafnode_conf.md#connecting-using-websocket-protocol) section. +See [Leafnode](../leafnodes/leafnode_conf.md#connecting-using-websocket-protocol) section.