diff options
author | Loïc Hoguin <[email protected]> | 2015-04-10 16:34:21 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-04-10 16:34:21 +0300 |
commit | cff0a87d3cbdcf67a9049cdc2784d459711e2867 (patch) | |
tree | 6eabc302b146843e8d00bd761be41b32d8f478d3 /doc/src/guide/websocket.asciidoc | |
parent | c46991067a53c81316a69c1df7c7dc590f3ca308 (diff) | |
download | gun-cff0a87d3cbdcf67a9049cdc2784d459711e2867.tar.gz gun-cff0a87d3cbdcf67a9049cdc2784d459711e2867.tar.bz2 gun-cff0a87d3cbdcf67a9049cdc2784d459711e2867.zip |
Add Websocket options
Allow passing Websocket options through either open or ws_upgrade.
Document ws_upgrade/4.
Diffstat (limited to 'doc/src/guide/websocket.asciidoc')
-rw-r--r-- | doc/src/guide/websocket.asciidoc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/src/guide/websocket.asciidoc b/doc/src/guide/websocket.asciidoc index 23c5030..83a8384 100644 --- a/doc/src/guide/websocket.asciidoc +++ b/doc/src/guide/websocket.asciidoc @@ -14,7 +14,7 @@ HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS. -You must use the `gun_ws:upgrade/{2,3}` function to upgrade +You must use the `gun_ws:upgrade/{2,3,4}` function to upgrade to Websocket. This function can be called anytime after connection, so you can send HTTP requests before upgrading to Websocket. @@ -34,6 +34,12 @@ gun:ws_upgrade(ConnPid, "/websocket", [ {<<"sec-websocket-protocol">>, "mychat"} ]). +You can pass the Websocket options as part of the `gun:open/{2,3}` +call when opening the connection, or using the `gun:ws_upgrade/4`. +The fourth argument is those same options. This function call +will crash if the options are incorrect, unlike when passing +them through `gun:open/{2,3}`. + The success or failure of this operation will be sent as a message. |