aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-07-17 12:25:11 +0200
committerLoïc Hoguin <[email protected]>2020-09-21 15:51:56 +0200
commit510d49d8ef0a46e90374c3230f28b5354115293f (patch)
tree2260d16089803e9e6e9c3e9156e21f83b0eae81c /src/gun.erl
parenta093bf88e1740e4f89937d84cd4d5b26cb5b4e80 (diff)
downloadgun-510d49d8ef0a46e90374c3230f28b5354115293f.tar.gz
gun-510d49d8ef0a46e90374c3230f28b5354115293f.tar.bz2
gun-510d49d8ef0a46e90374c3230f28b5354115293f.zip
Make gun:stream_info/2 return intermediaries for HTTP/2 CONNECT
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 0a0560d..8556b92 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -166,8 +166,8 @@
type := connect | socks5,
host := inet:hostname() | inet:ip_address(),
port := inet:port_number(),
- transport := tcp | tls | tls_proxy,
- protocol := http | http2 | raw | socks
+ transport := tcp | tls,
+ protocol := http | socks
}.
-type raw_opts() :: #{}.
@@ -1212,9 +1212,12 @@ connected(cast, {request, ReplyTo, StreamRef, Method, Path, Headers0, Body, Init
InitialFlow, EvHandler, EvHandlerState0),
{keep_state, State#state{protocol_state=ProtoState2, event_handler_state=EvHandlerState}};
connected(cast, {connect, ReplyTo, StreamRef, Destination, Headers, InitialFlow},
- State=#state{protocol=Protocol, protocol_state=ProtoState}) ->
+ State=#state{origin_host=Host, origin_port=Port,
+ protocol=Protocol, protocol_state=ProtoState}) ->
%% @todo Not events are currently handled for the request?
- ProtoState2 = Protocol:connect(ProtoState, StreamRef, ReplyTo, Destination, Headers, InitialFlow),
+ ProtoState2 = Protocol:connect(ProtoState, StreamRef, ReplyTo,
+ Destination, #{host => Host, port => Port},
+ Headers, InitialFlow),
{keep_state, State#state{protocol_state=ProtoState2}};
%% Public Websocket interface.
%% @todo Maybe make an interface in the protocol module instead of checking on protocol name.