fix(ipv6): fix wss ipv6 problem

This commit is contained in:
wangwenhai 2020-08-07 15:31:09 +08:00 committed by tigercl
parent 87780c1c1b
commit aca3053a7d
1 changed files with 15 additions and 8 deletions

View File

@ -1862,14 +1862,21 @@ end}.
TcpListeners = fun(Type, Name) ->
Prefix = string:join(["listener", Type, Name], "."),
case cuttlefish:conf_get(Prefix, Conf, undefined) of
ListenOnN = case cuttlefish:conf_get(Prefix, Conf, undefined) of
undefined -> [];
ListenOn ->
[{Atom(Type), ListenOn, [{deflate_options, DeflateOpts(Prefix)},
{tcp_options, TcpOpts(Prefix)} | LisOpts(Prefix)]}]
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