diff options
Diffstat (limited to 'src/ranch.erl')
-rw-r--r-- | src/ranch.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ranch.erl b/src/ranch.erl index 2664fd8..894f78b 100644 --- a/src/ranch.erl +++ b/src/ranch.erl @@ -25,6 +25,7 @@ -export([accept_ack/1]). -export([handshake/1]). -export([handshake/2]). +-export([recv_proxy_header/2]). -export([remove_connection/1]). -export([get_status/1]). -export([get_addr/1]). @@ -256,6 +257,16 @@ handshake(Ref, Opts) -> end end. +-spec recv_proxy_header(ref(), timeout()) + -> {ok, ranch_proxy_header:proxy_info()} + | {error, closed | atom()} + | {error, protocol_error, atom()}. +recv_proxy_header(Ref, Timeout) -> + receive HandshakeState={handshake, Ref, Transport, CSocket, _} -> + self() ! HandshakeState, + Transport:recv_proxy_header(CSocket, Timeout) + end. + -spec remove_connection(ref()) -> ok. remove_connection(Ref) -> ConnsSup = ranch_server:get_connections_sup(Ref), |