Ranch 2.1 adds counters and alarms.
The Prometheus collector was updated to include accepted/terminated connections metrics.
Ranch 2.1 is compatible with Erlang/OTP 22.0 onward. Support for Erlang/OTP 21 has been removed.
ranch:info/0,1. Currently includes accepted/terminated connection counts per connection supervisor.
num_connections. When the number of connections goes over a configurable treshold Ranch will call the given callback. This can be used to programmatically shut down idle connections to make up space for new connections, for example.
post_listencallback option has been added. It receives sockets immediately after the
Transport:listen/1call. It can be used for some additional initialization of the socket, such as setting file permissions on Unix domain sockets.
inet_backendoption is now properly handled and tested for TCP listeners. This allows using the experimental
socketbackend is now tested with Ranch. Note that there are known issues and Windows support is not currently implemented.
The following options are removed when using TLS 1.1, 1.2 or 1.3:
The following options are removed when using TLS 1.3 exclusively:
ranch_proxy_header:to_connection_info/1converts PROXY protocol information to the same format as
ssl:connection_information/1. Because there is little overlap only the
sni_hostnamewill be available, however.
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.