mod_proxy65: Expand @HOST@ keyword in 'hostname' option

This commit is contained in:
Marc Schink 2018-01-03 17:16:23 +01:00
parent 1fcb6d7f36
commit 264add87fa
1 changed files with 2 additions and 1 deletions

View File

@ -252,8 +252,9 @@ transform_module_options(Opts) ->
-spec get_streamhost(binary(), binary()) -> streamhost().
get_streamhost(Host, ServerHost) ->
{Port, IP} = get_port_ip(ServerHost),
HostName = gen_mod:get_module_opt(ServerHost, mod_proxy65, hostname,
HostName0 = gen_mod:get_module_opt(ServerHost, mod_proxy65, hostname,
misc:ip_to_list(IP)),
HostName = misc:expand_keyword(<<"@HOST@">>, HostName0, ServerHost),
Resource = ejabberd_cluster:node_id(),
#streamhost{jid = jid:make(<<"">>, Host, Resource),
host = HostName,