parse(Data :: binary())
-> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()}
| {error, HumanReadable :: atom()}
ranch_proxy_header:parse - Parse a PROXY protocol header
parse(Data :: binary())
-> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()}
| {error, HumanReadable :: atom()}
Parse a PROXY protocol header.
The PROXY protocol header optionally followed by more data.
An ok tuple is returned on success, containing the proxy information found in the header and the rest of the data if more was provided.
An error tuple is returned when a protocol error is detected. It contains a human readable message about the error.
{ok, ProxyInfo, Rest} = ranch_proxy_header:parse(Data).
ranch_proxy_header:header(3), ranch_proxy_header:to_connection_info(3), ranch_proxy_header(3)
Support my work on Cowboy, Ranch, Gun and Erlang.mk via GitHub Sponsors. The funds cover domain names and development tools.