aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-07-29 15:30:38 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:51:57 +0200
commitf1e7517c05bb97c257ad7a39e170ebc91ca42149 (patch)
treeb544e36bbc20c1bc63f21fde97d5345894db4d6d /src/gun.erl
parent048224a888b3331796e66dd974c6d75234e09036 (diff)
downloadgun-f1e7517c05bb97c257ad7a39e170ebc91ca42149.tar.gz
gun-f1e7517c05bb97c257ad7a39e170ebc91ca42149.tar.bz2
gun-f1e7517c05bb97c257ad7a39e170ebc91ca42149.zip
Make HTTP/2 CONNECT to a SOCKS server work
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 8b0b78d..987b806 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -115,19 +115,6 @@
| #{binary() | string() | atom() => iodata()}.
-export_type([req_headers/0]).
--type tunnel_info() :: #{
- stream_ref := reference() | [reference()],
-
- %% Tunnel.
- host := inet:hostname() | inet:ip_address(),
- port := inet:port_number(),
-
- %% Origin.
- origin_host => inet:hostname() | inet:ip_address(),
- origin_port => inet:port_number()
-}.
--export_type([tunnel_info/0]).
-
-type ws_close_code() :: 1000..4999.
-type ws_frame() :: close | ping | pong
@@ -183,6 +170,20 @@
protocol := http | socks
}.
+-type tunnel_info() :: #{
+ %% Tunnel.
+ host := inet:hostname() | inet:ip_address(),
+ port := inet:port_number(),
+
+ %% Origin.
+ origin_host => inet:hostname() | inet:ip_address(),
+ origin_port => inet:port_number(),
+
+ %% Non-stream intermediaries (for example SOCKS).
+ intermediaries => [intermediary()]
+}.
+-export_type([tunnel_info/0]).
+
-type raw_opts() :: #{}.
-export_type([raw_opts/0]).
@@ -1229,7 +1230,7 @@ connected(cast, {connect, ReplyTo, StreamRef, Destination, Headers, InitialFlow}
protocol=Protocol, protocol_state=ProtoState}) ->
%% @todo No events are currently handled for the CONNECT request?
ProtoState2 = Protocol:connect(ProtoState, StreamRef, ReplyTo,
- Destination, #{stream_ref => StreamRef, host => Host, port => Port},
+ Destination, #{host => Host, port => Port},
Headers, InitialFlow),
{keep_state, State#state{protocol_state=ProtoState2}};
%% Public Websocket interface.