Permalink
Browse files

Add Yaws SSL detection

  • Loading branch information...
1 parent 43e1b8f commit 006d7a581d1401d271eba7528bc62533a402b47d @choptastic choptastic committed Jun 3, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/yaws_bridge_modules/yaws_request_bridge.erl
View
8 src/yaws_bridge_modules/yaws_request_bridge.erl
@@ -35,7 +35,13 @@ uri(Arg) ->
peer_ip(Arg) ->
Socket = socket(Arg),
- {ok, {IP, _Port}} = inet:peername(Socket),
+ {ok, {IP, _Port}} =
+ case Socket of
+ S when is_tuple(S) andalso element(1, S) =:= sslsocket ->
+ ssl:peername(Socket);
+ _ ->
+ inet:peername(Socket)
+ end,
IP.
peer_port(Arg) ->

0 comments on commit 006d7a5

Please sign in to comment.