aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun_socks_up.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-22 15:04:37 +0200
committerLoïc Hoguin <[email protected]>2019-09-22 16:46:45 +0200
commit37b771210f94b9b692d0417d79483b9927d46ba2 (patch)
tree9081a202c1323028f15828a0520e53b6a2074d5e /doc/src/manual/gun_socks_up.asciidoc
parent0a5879ceffa3a96666ed8406c1557759811d8a16 (diff)
downloadgun-37b771210f94b9b692d0417d79483b9927d46ba2.tar.gz
gun-37b771210f94b9b692d0417d79483b9927d46ba2.tar.bz2
gun-37b771210f94b9b692d0417d79483b9927d46ba2.zip
Document Socks support
Also correct various Socks related types. This commit also adds a new gun:protocols/0 type as a simpler way of describing preferred protocols. The protocol/opts tuple is also documented. This commit also fixes an issue with the default value for the preferred protocols when using CONNECT over TLS. It was mistakenly not enabling http2 by default.
Diffstat (limited to 'doc/src/manual/gun_socks_up.asciidoc')
-rw-r--r--doc/src/manual/gun_socks_up.asciidoc66
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/src/manual/gun_socks_up.asciidoc b/doc/src/manual/gun_socks_up.asciidoc
new file mode 100644
index 0000000..e74f1a9
--- /dev/null
+++ b/doc/src/manual/gun_socks_up.asciidoc
@@ -0,0 +1,66 @@
+= gun_socks_up(3)
+
+== Name
+
+gun_socks_up - The Socks connection is up
+
+== Description
+
+[source,erlang]
+----
+{gun_socks_up, ConnPid, Protocol}
+
+ConnPid :: pid()
+Protocol :: http | http2 | socks
+----
+
+The Socks connection is up.
+
+This message informs the owner process that the connection
+completed through the configured Socks proxy.
+
+If Gun is configured to connect to another Socks server, then the
+connection is not usable yet. One or more
+link:man:gun_socks_up(3)[gun_socks_up(3)] messages will follow.
+
+Otherwise, Gun will start processing the messages it received while
+waiting for the connection to be up. If this is a reconnection,
+then this may not be desirable for all requests. Those requests
+should be cancelled when the connection goes down, and any
+subsequent messages ignored.
+
+== Elements
+
+ConnPid::
+
+The pid of the Gun connection process.
+
+Protocol::
+
+The protocol selected for this connection. It can be used
+to determine the capabilities of the server.
+
+== Changelog
+
+* *2.0*: Message introduced.
+
+== Examples
+
+.Receive a gun_socks_up message in a gen_server
+[source,erlang]
+----
+handle_info({gun_socks_up, ConnPid, _Protocol},
+ State=#state{conn_pid=ConnPid}) ->
+ %% Do something.
+ {noreply, State}.
+----
+
+== See also
+
+link:man:gun(3)[gun(3)],
+link:man:gun:open(3)[gun:open(3)],
+link:man:gun:open_unix(3)[gun:open_unix(3)],
+link:man:gun:await_up(3)[gun:await_up(3)],
+link:man:gun_up(3)[gun_up(3)],
+link:man:gun_down(3)[gun_down(3)],
+link:man:gun_error(3)[gun_error(3)]