25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

* src/mod_proxy65/mod_proxy65_service.erl: if an ip option is not defined, the module takes an IP address of a local hostname.

SVN Revision: 1925
This commit is contained in:
Evgeniy Khramtsov 2009-02-27 03:22:40 +00:00
parent 67e24366ee
commit b766109f66
2 changed files with 18 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2009-02-27 Evgeniy Khramtsov <ekhramtsov@process-one.net>
* src/mod_proxy65/mod_proxy65_service.erl: if an 'ip' option
is not defined, the module takes an IP address of a local hostname.
2009-02-26 Badlop <badlop@process-one.net>
* doc/guide.tex: No mention to the release date in ejabberd Guide

View File

@ -215,7 +215,7 @@ parse_options(ServerHost, Opts) ->
ACL = gen_mod:get_opt(access, Opts, all),
Name = gen_mod:get_opt(name, Opts, "SOCKS5 Bytestreams"),
IP = case gen_mod:get_opt(ip, Opts, none) of
none -> get_proxy_or_domainip(ServerHost, MyHost);
none -> get_my_ip();
Addr -> Addr
end,
StrIP = inet_parse:ntoa(IP),
@ -228,13 +228,9 @@ parse_options(ServerHost, Opts) ->
stream_addr = StreamAddr,
acl = ACL}.
%% Return the IP of the proxy host, or if not found, the ip of the xmpp domain
get_proxy_or_domainip(ServerHost, MyHost) ->
case inet:getaddr(MyHost, inet) of
{ok, Addr} -> Addr;
{error, _} ->
case inet:getaddr(ServerHost, inet) of
get_my_ip() ->
{ok, MyHostName} = inet:gethostname(),
case inet:getaddr(MyHostName, inet) of
{ok, Addr} -> Addr;
{error, _} -> {127,0,0,1}
end
end.