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).
Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:
Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.