summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-10-26 00:09:23 -0700
committerGarrett D'Amore <garrett@damore.org>2020-10-26 21:17:06 -0700
commitcaefd5cb745e2d1e8454dcda6753262f95812de4 (patch)
treef5d4b081670b19a8b979ae4a5eae23b91daa1126 /docs
parent4e7205cedb5f631d0fbbe72dbf89b5b9205a6260 (diff)
downloadnng-caefd5cb745e2d1e8454dcda6753262f95812de4.tar.gz
nng-caefd5cb745e2d1e8454dcda6753262f95812de4.tar.bz2
nng-caefd5cb745e2d1e8454dcda6753262f95812de4.zip
fixes #914 websocket stream mode should support TEXT
This adds new options, NNG_OPT_WS_SEND_TEXT and NNG_OPT_WS_RECV_TEXT that permit communication with WebSocket peers that insist on using TEXT frames (stream mode only). The support is limited, as NNG does no validation of the frame contents to check for UTF-8 compliance.
Diffstat (limited to 'docs')
-rw-r--r--docs/man/nng_ws.7.adoc26
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/man/nng_ws.7.adoc b/docs/man/nng_ws.7.adoc
index 18baedfa..349955b1 100644
--- a/docs/man/nng_ws.7.adoc
+++ b/docs/man/nng_ws.7.adoc
@@ -128,7 +128,7 @@ only available for `wss://` endpoints.
((`NNG_OPT_WS_REQUEST_HEADERS`))::
-(string) Concentation of multiple lines terminated
+(string) Concatenation of multiple lines terminated
by CRLF sequences, that can be used to add further headers to the
HTTP request sent when connecting.
This option can be set on dialers, and retrieved from pipes.
@@ -140,6 +140,30 @@ by CRLF sequences, that can be used to add further headers to the
HTTP response sent when connecting.
This option can be set on listeners, and retrieved from pipes.
+((`NNG_OPT_WS_RECV_TEXT`))::
+
+(bool) Enable receiving of TEXT frames at the WebSocket layer.
+This option should only be used with the low level
+xref:nng_stream.5.adoc[`nng_stream`] API.
+When set, the stream will accept in-bound TEXT frames as well as BINARY frames.
+
+NOTE: The SP protocols (such as xref:nng_req.7.adoc[REQ]) require BINARY frames as they pass binary protocol data.
+Hence this option should not be used with such protocols.
+
+NOTE: RFC 6455 requires that TEXT frames be discarded and the connection closed if the frame does not contain valid UTF-8 data.
+NNG does not perform any such validation.
+Applications that need to be strictly conformant should check for this themselves.
+
+((`NNG_OPT_WS_SEND_TEXT`))::
+
+(bool) Enable sending of TEXT frames at the WebSocket layer.
+This option should only be used with the low level
+xref:nng_stream.5.adoc[`nng_stream`] API.
+When set, the stream will send TEXT frames instead of BINARY frames.
+
+NOTE: NNG does not check the frame data, and will attempt to send whatever the client requests.
+Peers that are compliant with RFC 6455 will discard TEXT frames (and break the connection) if they do not contain valid UTF-8.
+
((`NNG_OPT_TLS_CONFIG`))::
(`nng_tls_config *`) The underlying TLS