get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()}
ranch:get_addr - Get the listening port and IP
get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()}
Get the listening port and IP.
The listener name.
The address of the listener is returned as a tuple.
The IP address is the IP of the network interface the socket is bound to.
{IP, Port} = ranch:get_addr(example).
ranch:start_listener(3), ranch:get_port(3), ranch:info(3), ranch(3)
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.