diff options
author | Loïc Hoguin <[email protected]> | 2020-11-12 14:00:41 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-11-12 14:00:41 +0100 |
commit | 4a58077d5162325fa5723690e58e7364adbcb18c (patch) | |
tree | 6f088a7a9b9d1f6b0eacdeb98de1eb5b8032b647 /doc/src/guide/protocols.asciidoc | |
parent | 1ebad8acf803eb797a6c61f6522ebc3b79f104a1 (diff) | |
download | gun-4a58077d5162325fa5723690e58e7364adbcb18c.tar.gz gun-4a58077d5162325fa5723690e58e7364adbcb18c.tar.bz2 gun-4a58077d5162325fa5723690e58e7364adbcb18c.zip |
Replace gun:ws_send/2 with gun:ws_send/3
Switching from /2 to /3 should be easy enough.
Also update the documentation about HTTP/2 Websocket support.
Diffstat (limited to 'doc/src/guide/protocols.asciidoc')
-rw-r--r-- | doc/src/guide/protocols.asciidoc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/doc/src/guide/protocols.asciidoc b/doc/src/guide/protocols.asciidoc index d2529e3..cd6de2c 100644 --- a/doc/src/guide/protocols.asciidoc +++ b/doc/src/guide/protocols.asciidoc @@ -65,10 +65,6 @@ cancellation mechanism which allows Gun to inform the server to stop sending a response for this particular request, saving resources. -It is not currently possible to upgrade an HTTP/2 connection -to Websocket. Support for this will be added in a future -release. - === Websocket Websocket is a binary protocol built on top of HTTP that @@ -76,12 +72,9 @@ allows asynchronous concurrent communication between the client and the server. A Websocket server can push data to the client at any time. -Websocket is only available as a connection upgrade over -an HTTP/1.1 connection. - -Once the Websocket connection is established, the only -operation available on this connection is sending Websocket -frames using `gun:ws_send/2`. +Once the Websocket connection is established over an HTTP/1.1 +connection, the only operation available on this connection +is sending Websocket frames using `gun:ws_send/3`. Gun will send a `gun_ws` message for every frame received. @@ -108,7 +101,7 @@ current protocol. | await_body | yes | yes | no | flush | yes | yes | no | cancel | yes | yes | no -| ws_upgrade | yes | no | no +| ws_upgrade | yes | yes | no | ws_send | no | no | yes |=== @@ -122,6 +115,6 @@ current protocol. | gun_data | yes | yes | no | gun_trailers | yes | yes | no | gun_error | yes | yes | yes -| gun_upgrade | yes | no | no +| gun_upgrade | yes | yes | no | gun_ws | no | no | yes |=== |