fix: split 'server' param into host and port for mqtt bridge
This commit is contained in:
parent
d55404cc99
commit
c85a988a43
|
@ -504,7 +504,10 @@ do_probe(ConnType, Params) ->
|
|||
end.
|
||||
|
||||
host_and_port(mqtt, #{<<"server">> := Server}) ->
|
||||
Server;
|
||||
case string:split(Server, ":") of
|
||||
[Host, Port] -> {Host, list_to_integer(Port)};
|
||||
_Other -> error(invalid_server, Server)
|
||||
end;
|
||||
host_and_port(webhook, #{<<"url">> := Url}) ->
|
||||
{BaseUrl, _Path} = parse_url(Url),
|
||||
{ok, #{host := Host, port := Port}} = emqx_http_lib:uri_parse(BaseUrl),
|
||||
|
|
Loading…
Reference in New Issue