Ranch 1.7 adds built-in support for the PROXY protocol.
The PROXY protocol is a simple and efficient way for proxies to transmit information about the client.
While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call.
Ranch 1.7 is compatible with Erlang/OTP 19.0 onward. Support for Erlang/OTP 18 has been removed.
ranch:recv_proxy_header/2to receive the PROXY protocol header and parse it. It must be called before
ranch_proxy_header:header/1,2to parse and build a PROXY protocol header, respectively.
ranch_listener_supcrashes. This resulted in the original options being used even if the options were updated at runtime.