Merge pull request #8141 from lafirest/fix/gateway_listen_addr

fix(gateway): gateway listen-address add support for `host:port` format
This commit is contained in:
lafirest 2022-06-07 11:01:29 +08:00 committed by GitHub
commit ecd46d42cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -200,14 +200,10 @@ bind2str(LConf = #{bind := Bind}) when is_binary(Bind) ->
bind2str(LConf = #{<<"bind">> := Bind}) when is_binary(Bind) -> bind2str(LConf = #{<<"bind">> := Bind}) when is_binary(Bind) ->
LConf. LConf.
get_bind(#{bind := Bind}) when is_integer(Bind) -> get_bind(#{bind := Bind}) ->
Bind; emqx_gateway_utils:parse_listenon(Bind);
get_bind(#{<<"bind">> := Bind}) when is_integer(Bind) -> get_bind(#{<<"bind">> := Bind}) ->
Bind; emqx_gateway_utils:parse_listenon(Bind).
get_bind(#{bind := Bind}) when is_binary(Bind) ->
erlang:binary_to_integer(Bind);
get_bind(#{<<"bind">> := Bind}) when is_binary(Bind) ->
erlang:binary_to_integer(Bind).
-spec listeners(atom_or_bin()) -> [map()]. -spec listeners(atom_or_bin()) -> [map()].
listeners(GwName0) -> listeners(GwName0) ->