diff options
author | ekhramtsov <ekhramtsov@process-one.net> | 2010-02-17 23:17:33 +0900 |
---|---|---|
committer | ekhramtsov <ekhramtsov@process-one.net> | 2010-02-17 23:17:33 +0900 |
commit | 1a96944929617c85f127b994670ec7069e6dec71 (patch) | |
tree | 482163b953a2c142ccfcc960360b62846c4db1b4 /src | |
parent | Close also legacy sessions that were half connected (thanks to Evgeniy Khramt... (diff) |
new option "hostname" is added (thanks to Stefan Hepp) (EJAB-838)
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_proxy65/mod_proxy65_service.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mod_proxy65/mod_proxy65_service.erl b/src/mod_proxy65/mod_proxy65_service.erl index 545c7c0e4..b2869e3af 100644 --- a/src/mod_proxy65/mod_proxy65_service.erl +++ b/src/mod_proxy65/mod_proxy65_service.erl @@ -222,8 +222,16 @@ parse_options(ServerHost, Opts) -> none -> get_my_ip(); Addr -> Addr end, - StrIP = inet_parse:ntoa(IP), - StreamAddr = [{"jid", MyHost}, {"host", StrIP}, {"port", integer_to_list(Port)}], + HostName = case gen_mod:get_opt(hostname, Opts, none) of + none -> + inet_parse:ntoa(IP); + HostAddr when is_tuple(HostAddr) -> + inet_parse:ntoa(HostAddr); + HostNameStr -> + HostNameStr + end, + StreamAddr = [{"jid", MyHost}, {"host", HostName}, + {"port", integer_to_list(Port)}], #state{myhost = MyHost, serverhost = ServerHost, name = Name, |