commit
470e76346f
|
@ -1021,14 +1021,32 @@ end}.
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
ApiListeners = fun(Type, Name) ->
|
||||||
|
Prefix = string:join(["listener", Type, Name], "."),
|
||||||
|
case cuttlefish:conf_get(Prefix, Conf, undefined) of
|
||||||
|
undefined ->
|
||||||
|
[];
|
||||||
|
ListenOn ->
|
||||||
|
SslOpts1 = case SslOpts(Prefix) of
|
||||||
|
[] -> [];
|
||||||
|
SslOpts0 -> [{sslopts, SslOpts0}]
|
||||||
|
end,
|
||||||
|
[{Atom(Type), ListenOn, [{connopts, ConnOpts(Prefix)},
|
||||||
|
{sockopts, TcpOpts(Prefix)}| LisOpts(Prefix)] ++ SslOpts1}]
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
|
||||||
lists:flatten([TcpListeners(Type, Name) || {["listener", Type, Name], ListenOn}
|
lists:flatten([TcpListeners(Type, Name) || {["listener", Type, Name], ListenOn}
|
||||||
<- cuttlefish_variable:filter_by_prefix("listener.tcp", Conf)
|
<- cuttlefish_variable:filter_by_prefix("listener.tcp", Conf)
|
||||||
++ cuttlefish_variable:filter_by_prefix("listener.ws", Conf)]
|
++ cuttlefish_variable:filter_by_prefix("listener.ws", Conf)]
|
||||||
++
|
++
|
||||||
[SslListeners(Type, Name) || {["listener", Type, Name], ListenOn}
|
[SslListeners(Type, Name) || {["listener", Type, Name], ListenOn}
|
||||||
<- cuttlefish_variable:filter_by_prefix("listener.ssl", Conf)
|
<- cuttlefish_variable:filter_by_prefix("listener.ssl", Conf)
|
||||||
++ cuttlefish_variable:filter_by_prefix("listener.wss", Conf)
|
++ cuttlefish_variable:filter_by_prefix("listener.wss", Conf)]
|
||||||
++ cuttlefish_variable:filter_by_prefix("listener.api", Conf)])
|
++
|
||||||
|
[ApiListeners(Type, Name) || {["listener", Type, Name], ListenOn}
|
||||||
|
<- cuttlefish_variable:filter_by_prefix("listener.api", Conf)])
|
||||||
end}.
|
end}.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue