浏览代码

fix(gateway): gateway listen-address add support for `host:port` format

firest 3 年之前
父节点
当前提交
16da9cbcb4
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4 8
      apps/emqx_gateway/src/emqx_gateway_conf.erl

+ 4 - 8
apps/emqx_gateway/src/emqx_gateway_conf.erl

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