aboutsummaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rw-r--r--test/event_SUITE.erl4
-rw-r--r--test/socks_SUITE.erl6
2 files changed, 5 insertions, 5 deletions
diff --git a/test/event_SUITE.erl b/test/event_SUITE.erl
index 977eec4..5510e8c 100644
--- a/test/event_SUITE.erl
+++ b/test/event_SUITE.erl
@@ -315,7 +315,7 @@ http1_tls_handshake_end_ok_connect(Config) ->
socket := Socket,
tls_opts := _,
timeout := _,
- protocol := http
+ protocol := http2
} = do_receive_event(tls_handshake_end),
true = is_tuple(Socket),
gun:close(ConnPid).
@@ -405,7 +405,7 @@ http1_tls_handshake_end_ok_connect_over_https_proxy(Config) ->
socket := Socket,
tls_opts := _,
timeout := _,
- protocol := http
+ protocol := http2
} = do_receive_event(tls_handshake_end),
true = is_pid(Socket),
gun:close(ConnPid).
diff --git a/test/socks_SUITE.erl b/test/socks_SUITE.erl
index 060c89f..ec184a6 100644
--- a/test/socks_SUITE.erl
+++ b/test/socks_SUITE.erl
@@ -222,7 +222,7 @@ do_socks5(OriginScheme, OriginTransport, OriginProtocol, ProxyTransport, SocksAu
protocols => [OriginProtocol]
}}]
}),
- %% We receive a gun_up and a gun_socks_connected.
+ %% We receive a gun_up and a gun_socks_up.
{ok, socks} = gun:await_up(ConnPid),
{ok, OriginProtocol} = gun:await_up(ConnPid),
%% The proxy received two packets.
@@ -300,7 +300,7 @@ do_socks5_through_multiple_proxies(OriginScheme, OriginTransport, ProxyTransport
}}]
}}]
}),
- %% We receive a gun_up and two gun_socks_connected.
+ %% We receive a gun_up and two gun_socks_up.
{ok, socks} = gun:await_up(ConnPid),
{ok, socks} = gun:await_up(ConnPid),
{ok, http} = gun:await_up(ConnPid),
@@ -386,7 +386,7 @@ do_socks5_through_connect_proxy(OriginScheme, OriginTransport, ProxyTransport) -
}),
{request, <<"CONNECT">>, Authority1, 'HTTP/1.1', _} = receive_from(Proxy1Pid),
{response, fin, 200, _} = gun:await(ConnPid, StreamRef),
- %% We receive a gun_socks_connected afterwards. This is the origin HTTP server.
+ %% We receive a gun_socks_up afterwards. This is the origin HTTP server.
{ok, http} = gun:await_up(ConnPid),
%% The second proxy receives a Socks5 auth/connect request.
{auth_methods, 1, [none]} = receive_from(Proxy2Pid),