You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running toxiproxy server on a remote host with -config and trying to use toxiproxy-cli against it with the --host flag it gets connect: connection refused error.
After running with and without the config file, I eventually noticed that when running without, the toxiproxy server log for starting the API server looks like this:
{"level":"info","host":"0.0.0.0","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2023-06-20T19:59:52Z","message":"Starting HTTP server on endpoint 0.0.0.0:8474"}
but when running with config it looks like this {"level":"info","host":"localhost","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2023-06-20T19:59:52Z","message":"Starting HTTP server on endpoint localhost:8474"}
with "localhost" rather than "0.0.0.0" and since I'm running toxiproxy-cli with --host http://<host_ip>:8474 (i.e. the host is an IP and not localhost) it refuses the connection.
I'm able to work around it by explicitly running the server with -host 0.0.0.0, but find it odd that the listen host would be different depending on if a config is used or not (actually, I suspect the act of creating proxies before the API server starts is what actually impacts it, based on a quick read of the code).
The text was updated successfully, but these errors were encountered:
The reason is that if you add only the -config parameter in the command, it overrides the -host parameter this is set in the docker image. With docker inspect you can see these default settings in the docker image:
When running toxiproxy server on a remote host with
-config
and trying to use toxiproxy-cli against it with the--host
flag it getsconnect: connection refused
error.The content of my config file is
After running with and without the config file, I eventually noticed that when running without, the toxiproxy server log for starting the API server looks like this:
{"level":"info","host":"0.0.0.0","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2023-06-20T19:59:52Z","message":"Starting HTTP server on endpoint 0.0.0.0:8474"}
but when running with config it looks like this
{"level":"info","host":"localhost","port":"8474","version":"2.5.0","caller":"api.go:119","time":"2023-06-20T19:59:52Z","message":"Starting HTTP server on endpoint localhost:8474"}
with "localhost" rather than "0.0.0.0" and since I'm running toxiproxy-cli with
--host http://<host_ip>:8474
(i.e. the host is an IP and not localhost) it refuses the connection.I'm able to work around it by explicitly running the server with
-host 0.0.0.0
, but find it odd that the listen host would be different depending on if a config is used or not (actually, I suspect the act of creating proxies before the API server starts is what actually impacts it, based on a quick read of the code).The text was updated successfully, but these errors were encountered: