diff options
Diffstat (limited to 'src/cowboy_ssl_transport.erl')
-rw-r--r-- | src/cowboy_ssl_transport.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cowboy_ssl_transport.erl b/src/cowboy_ssl_transport.erl index 8074209..3b130f0 100644 --- a/src/cowboy_ssl_transport.erl +++ b/src/cowboy_ssl_transport.erl @@ -24,7 +24,7 @@ %% @see ssl -module(cowboy_ssl_transport). -export([name/0, messages/0, listen/1, accept/2, recv/3, send/2, setopts/2, - controlling_process/2, peername/1, close/1]). + controlling_process/2, peername/1, close/1, sockname/1]). %% @doc Name of this transport API, <em>ssl</em>. -spec name() -> ssl. @@ -140,6 +140,13 @@ peername(Socket) -> close(Socket) -> ssl:close(Socket). +%% @doc Get the local address and port of a socket +%% @see ssl:sockname/1 +-spec sockname(ssl:sslsocket()) + -> {ok, {inet:ip_address(), inet:port_number()}} | {error, atom()}. +sockname(Socket) -> + ssl:sockname(Socket). + %% Internal. -spec require(list(module())) -> ok. |