Merge pull request #8005 from thalesmg/fix-mgmt-listener-port

fix(mgmt): allow binding to specific interface
This commit is contained in:
JianBo He 2022-05-23 18:01:45 +08:00 committed by GitHub
commit b97f7fa8fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -227,6 +227,13 @@ end}.
Prefix = "management.listener." ++ atom_to_list(Proto), Prefix = "management.listener." ++ atom_to_list(Proto),
case cuttlefish:conf_get(Prefix, Conf, undefined) of case cuttlefish:conf_get(Prefix, Conf, undefined) of
undefined -> Acc; undefined -> Acc;
{IPStr, Port} ->
{ok, IP} = inet:parse_address(IPStr),
[{Proto, Port, [{ip, IP}] ++ TcpOpts(Prefix) ++ Opts(Prefix)
++ case Proto of
http -> [];
https -> SslOpts(Prefix)
end} | Acc];
Port -> Port ->
[{Proto, Port, TcpOpts(Prefix) ++ Opts(Prefix) [{Proto, Port, TcpOpts(Prefix) ++ Opts(Prefix)
++ case Proto of ++ case Proto of
@ -236,4 +243,3 @@ end}.
end end
end, [], [http, https]) end, [], [http, https])
end}. end}.