diff options
author | Loïc Hoguin <[email protected]> | 2019-04-22 13:40:07 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-04-22 13:40:07 +0200 |
commit | 5e3a5337a34dcb09418d4f412b11ede4510e3ddc (patch) | |
tree | 294fde46b7b0775ce62c854892ddcf1c4a73ead2 /src/gun_http.erl | |
parent | b2aed85a2a8794f0cc23755d1a10c602ab289ff4 (diff) | |
download | gun-5e3a5337a34dcb09418d4f412b11ede4510e3ddc.tar.gz gun-5e3a5337a34dcb09418d4f412b11ede4510e3ddc.tar.bz2 gun-5e3a5337a34dcb09418d4f412b11ede4510e3ddc.zip |
Make gun_tls_proxy work for HTTP/2 connections
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r-- | src/gun_http.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl index efcea35..02344ee 100644 --- a/src/gun_http.erl +++ b/src/gun_http.erl @@ -231,12 +231,12 @@ handle_head(Data, State=#http_state{socket=Socket, transport=Transport, TLSTimeout = maps:get(tls_handshake_timeout, Destination, infinity), {ok, ProxyPid} = gun_tls_proxy:start_link(NewHost, NewPort, TLSOpts, TLSTimeout, Socket, gun_tls), + %% In this case the switch_protocol is delayed and is handled by + %% a message sent from gun_tls_proxy once the connection is established, + %% and handled by the gun module directly. [{state, State2#http_state{socket=ProxyPid, transport=gun_tls_proxy}}, {origin, <<"https">>, NewHost, NewPort, connect}, {switch_transport, gun_tls_proxy, ProxyPid}]; - %% @todo Might also need to switch protocol, but gotta wait - %% @todo for the TLS connection to be established first. - %% @todo Should have a gun_tls_proxy event indicating connection success. #{transport := tls} -> TLSOpts = maps:get(tls_opts, Destination, []), TLSTimeout = maps:get(tls_handshake_timeout, Destination, infinity), |