diff options
author | Loïc Hoguin <[email protected]> | 2015-04-08 23:34:08 +0300 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-04-08 23:34:08 +0300 |
commit | 8366ba94bb9e450221a246acdd482c0162affcd9 (patch) | |
tree | 5797de02c7f00760d50136c33502eaee654378dd /doc/src/guide | |
parent | 335eb50a06c574fb9dfb50cac6185aa18e8c3834 (diff) | |
download | gun-8366ba94bb9e450221a246acdd482c0162affcd9.tar.gz gun-8366ba94bb9e450221a246acdd482c0162affcd9.tar.bz2 gun-8366ba94bb9e450221a246acdd482c0162affcd9.zip |
Use maps for and improve options
The type option has been removed. The transport and protocols
options can be used in its place.
The transport_opts option can be used to specify transport
options.
The http_opts and spdy_opts options can be used to specify
protocol specific options.
The keepalive option is now a protocol specific option.
Defaults depending on the port number have changed. Now only
port 443 uses ssl by default, other ports use tcp.
Diffstat (limited to 'doc/src/guide')
-rw-r--r-- | doc/src/guide/connect.asciidoc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/src/guide/connect.asciidoc b/doc/src/guide/connect.asciidoc index e1ad56e..e2bcaa7 100644 --- a/doc/src/guide/connect.asciidoc +++ b/doc/src/guide/connect.asciidoc @@ -33,16 +33,24 @@ The `gun:open/{2,3}` function must be used to open a connection. [source,erlang] {ok, ConnPid} = gun:open("example.org", 443). -@todo open/3 -@todo make opts a map +If the port given is 443, Gun will attempt to connect using +SSL. The protocol will be selected automatically using the +NPN extension for TLS. By default Gun supports SPDY/3.1, +SPDY/3 and HTTP/1.1 when connecting using SSL. -If the port given is 80, Gun will attempt to connect using -TCP and use the HTTP/1.1 protocol. For any other port, TLS -will be used. The NPN extension for TLS allows Gun to select -SPDY automatically if the server supports it. Otherwise, -HTTP/1.1 will be used. +For any other port, Gun will attempt to connect using TCP +and will use the HTTP/1.1 protocol. -@todo more about defaults +The transport and protocol used can be overriden using +options. The manual documents all available options. + +Options can be provided as a third argument, and take the +form of a map. + +.Opening an SSL connection to example.org on port 8443 + +[source,erlang] +{ok, ConnPid} = gun:open("example.org", 8443, #{transport=>ssl}). === Monitoring the connection process |