aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-09-21 12:18:03 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:52:26 +0200
commit43df59e49b1ab92e3ca0a333ae403742b2ed7a5d (patch)
treec0903c6588ab829109e9cd79bb6b2652d2fd34eb /test
parent8033850ab81ca0639489636bb8760d93900d4a80 (diff)
downloadgun-43df59e49b1ab92e3ca0a333ae403742b2ed7a5d.tar.gz
gun-43df59e49b1ab92e3ca0a333ae403742b2ed7a5d.tar.bz2
gun-43df59e49b1ab92e3ca0a333ae403742b2ed7a5d.zip
Fix gun:stream_info/2 when gun_tunnel is involved
Diffstat (limited to 'test')
-rw-r--r--test/socks_SUITE.erl17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/socks_SUITE.erl b/test/socks_SUITE.erl
index 3b8c822..f912256 100644
--- a/test/socks_SUITE.erl
+++ b/test/socks_SUITE.erl
@@ -421,7 +421,7 @@ socks5_tcp_through_h2_connect_tcp_to_tcp_origin(_) ->
"a TCP HTTP/2 proxy followed by a Socks5 proxy."),
do_socks5_through_h2_connect_proxy(<<"http">>, tcp, <<"http">>, tcp).
-do_socks5_through_h2_connect_proxy(OriginScheme, OriginTransport, ProxyScheme, ProxyTransport) ->
+do_socks5_through_h2_connect_proxy(_OriginScheme, OriginTransport, ProxyScheme, ProxyTransport) ->
{ok, OriginPid, OriginPort} = init_origin(OriginTransport, http),
{ok, Proxy1Pid, Proxy1Port} = rfc7540_SUITE:do_proxy_start(ProxyTransport, [
{proxy_stream, 1, 200, [], 0, undefined}
@@ -475,17 +475,26 @@ do_socks5_through_h2_connect_proxy(OriginScheme, OriginTransport, ProxyScheme, P
reply_to := Self,
state := running,
tunnel := #{
- transport := OriginTransport,
+ transport := ProxyTransport,
protocol := http,
- origin_scheme := OriginScheme,
+ %% @todo They're not necessarily the origin. Should be named scheme/host/port.
+ origin_scheme := ProxyScheme,
origin_host := "localhost",
- origin_port := OriginPort
+ origin_port := Proxy2Port
}
}} = gun:stream_info(ConnPid, StreamRef),
{ok, #{
ref := ProxiedStreamRef,
reply_to := Self,
state := running,
+%% @todo Add "authority" when the stream is not a tunnel.
+% authority := #{
+% scheme := OriginScheme
+% transport :=
+% protocol :=
+% host :=
+% port :=
+% },
intermediaries := [#{
type := connect,
host := "localhost",