From: Marc Schink Date: Wed, 3 Jan 2018 16:16:23 +0000 (+0100) Subject: mod_proxy65: Expand @HOST@ keyword in 'hostname' option X-Git-Tag: 18.01~26^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=264add87fa1f8e84f3a9eb237a1a5ecd5209aa6c;p=ejabberd mod_proxy65: Expand @HOST@ keyword in 'hostname' option --- diff --git a/src/mod_proxy65_service.erl b/src/mod_proxy65_service.erl index fb34ba554..721ebabe3 100644 --- a/src/mod_proxy65_service.erl +++ b/src/mod_proxy65_service.erl @@ -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,