aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-07-23 17:22:21 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:51:56 +0200
commit323bd167fd33f322ab8747e398e54a8a36f5b753 (patch)
tree8105c23a63f76eb204ea32f4b29e933a18976b5e /src/gun.erl
parentf8272a1e8d5fbf3b8021479d142a2002846fe062 (diff)
downloadgun-323bd167fd33f322ab8747e398e54a8a36f5b753.tar.gz
gun-323bd167fd33f322ab8747e398e54a8a36f5b753.tar.bz2
gun-323bd167fd33f322ab8747e398e54a8a36f5b753.zip
Add the base_stream_ref to gun_http/gun_http2
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 8556b92..00e2d82 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -115,6 +115,19 @@
| #{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
@@ -1214,9 +1227,9 @@ connected(cast, {request, ReplyTo, StreamRef, Method, Path, Headers0, Body, Init
connected(cast, {connect, ReplyTo, StreamRef, Destination, Headers, InitialFlow},
State=#state{origin_host=Host, origin_port=Port,
protocol=Protocol, protocol_state=ProtoState}) ->
- %% @todo Not events are currently handled for the request?
+ %% @todo No events are currently handled for the CONNECT request?
ProtoState2 = Protocol:connect(ProtoState, StreamRef, ReplyTo,
- Destination, #{host => Host, port => Port},
+ Destination, #{stream_ref => StreamRef, host => Host, port => Port},
Headers, InitialFlow),
{keep_state, State#state{protocol_state=ProtoState2}};
%% Public Websocket interface.