diff options
author | Loïc Hoguin <[email protected]> | 2020-07-23 17:22:21 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-09-21 15:51:56 +0200 |
commit | 323bd167fd33f322ab8747e398e54a8a36f5b753 (patch) | |
tree | 8105c23a63f76eb204ea32f4b29e933a18976b5e /src/gun.erl | |
parent | f8272a1e8d5fbf3b8021479d142a2002846fe062 (diff) | |
download | gun-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.erl | 17 |
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. |