aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-04-10 16:34:21 +0300
committerLoïc Hoguin <[email protected]>2015-04-10 16:34:21 +0300
commitcff0a87d3cbdcf67a9049cdc2784d459711e2867 (patch)
tree6eabc302b146843e8d00bd761be41b32d8f478d3 /doc/src/manual/gun.asciidoc
parentc46991067a53c81316a69c1df7c7dc590f3ca308 (diff)
downloadgun-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/manual/gun.asciidoc')
-rw-r--r--doc/src/manual/gun.asciidoc18
1 files changed, 11 insertions, 7 deletions
diff --git a/doc/src/manual/gun.asciidoc b/doc/src/manual/gun.asciidoc
index fb457a4..7c12fc3 100644
--- a/doc/src/manual/gun.asciidoc
+++ b/doc/src/manual/gun.asciidoc
@@ -18,7 +18,7 @@ Configuration for the connection.
The following keys are defined:
-http_opts => gun:http_opts()::
+http_opts => http_opts()::
Options specific to the HTTP protocol. See below.
protocols => [http | spdy]::
Ordered list of preferred protocols. When the transport is tcp,
@@ -33,7 +33,7 @@ retry => non_neg_integer()::
Defaults to 5.
retry_timeout => pos_integer()::
Time between retries in milliseconds. Defaults to 5000.
-spdy_opts => gun:spdy_opts()::
+spdy_opts => spdy_opts()::
Options specific to the SPDY protocol. See below.
trace => boolean()::
Whether to enable `dbg` tracing of the connection process. Should
@@ -44,6 +44,8 @@ transport => tcp | ssl::
transport_opts => proplists:proplist()::
Transport options. They are TCP options or SSL options depending on
the selected transport.
+ws_opts => ws_opts()::
+ Options specific to the Websocket protocol. See below.
=== http_opts() = map()
@@ -640,18 +642,20 @@ SPDY streams can however be cancelled at any time.
=== ws_upgrade(ConnPid, Path) -> ws_upgrade(ConnPid, Path, [], #{})
-Alias of `gun:ws_upgrade/4`.
+Alias of `gun:ws_upgrade/3`.
-=== ws_upgrade(ConnPid, Path, Headers) -> ws_upgrade(ConnPid, Path, Headers, #{})
+=== ws_upgrade(ConnPid, Path, Headers) -> ok
-Alias of `gun:ws_upgrade/4`.
+Similar to `gun:ws_upgrade/4`, except `WsOpts` is taken from
+the options given in the `gun:open/{2,3}` call when opening
+the connection.
-=== ws_upgrade(ConnPid, Path, Headers, Opts) -> ok
+=== ws_upgrade(ConnPid, Path, Headers, WsOpts) -> ok
ConnPid = pid():: The pid of the Gun connection process.
Path = iodata():: Path to the resource.
Headers = [{binary(), iodata()}]:: Additional request headers.
-Opts = map():: Options for the Websocket connection.
+WsOpts = map():: Options for the Websocket connection.
Request the connection to be upgraded to the Websocket protocol.