From aca3053a7d616fa64a79553ce8e8ae1f66781037 Mon Sep 17 00:00:00 2001 From: wangwenhai <751957846@qq.com> Date: Fri, 7 Aug 2020 15:31:09 +0800 Subject: [PATCH] fix(ipv6): fix wss ipv6 problem --- priv/emqx.schema | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/priv/emqx.schema b/priv/emqx.schema index 335f84aa8..20d2a09a0 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -1861,15 +1861,22 @@ end}. end, TcpListeners = fun(Type, Name) -> - Prefix = string:join(["listener", Type, Name], "."), - case cuttlefish:conf_get(Prefix, Conf, undefined) of - undefined -> []; - ListenOn -> - [{Atom(Type), ListenOn, [{deflate_options, DeflateOpts(Prefix)}, - {tcp_options, TcpOpts(Prefix)} | LisOpts(Prefix)]}] - end + Prefix = string:join(["listener", Type, Name], "."), + ListenOnN = case cuttlefish:conf_get(Prefix, Conf, undefined) of + undefined -> []; + ListenOn -> + case ListenOn of + {Ip, Port} -> + case inet:parse_address(Ip) of + {ok ,R} -> {R, Port}; + _ -> {Ip, Port} + end; + Other -> Other + end + end, + [{Atom(Type), ListenOnN, [{deflate_options, DeflateOpts(Prefix)}, + {tcp_options, TcpOpts(Prefix)} | LisOpts(Prefix)]}] end, - SslListeners = fun(Type, Name) -> Prefix = string:join(["listener", Type, Name], "."), case cuttlefish:conf_get(Prefix, Conf, undefined) of