Created
August 21, 2014 22:11
-
-
Save mattdeboard/00ea62d7ec2f264970f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def init(conn) do | |
Process.flag :trap_exit, true | |
{ip, port} = conn |> Socket.remote! | |
host = case Socket.Host.by_address(ip) do | |
{:ok, _host} -> | |
_host.name | |
{:error, _} -> | |
Socket.Address.format ip | |
end | |
{listener, secure} = | |
case nil? conn.listener do | |
true -> | |
{nil, nil} | |
false -> | |
{conn.listener, conn.listener.secure} | |
end | |
{:ok, conn} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment