Open ElasticCoder opened 4 years ago
@ElasticCoder I would like to understand the test scenario for this case. Pls correct me if I understand correctly?
port 8081: Connection refused
Currently, it is possible to simulate a closed port behavior with toggle
feature.
$ toxiproxy-cli create -l 0.0.0.0:20000 -u google.com:443 google_https
$ curl localhost:23232
curl: (7) Failed to connect to localhost port 23232: Connection refused
$ curl localhost:20000
curl: (52) Empty reply from server
$ toxiproxy-cli tog google_https
$ curl localhost:20000
curl: (7) Failed to connect to localhost port 20000: Connection refused
Idea how to toggle automatically, it is when the Upstream gracefully shutdown the connection, then server should switch stated to Disabled. But it would require user to toggle back in case upstream restored.
I am able to connect my client to the proxy even if the upstream server socket is not accepting connections. This means I cannot test all my use cases (e.g. server is absent) because the proxy will accept the connection on behalf of the upstream. When I go to send data it errors, but I would rather the socket is not accepted if upstream is down.
An alternative would be if the upstream rule is disabled then the proxy does not accept connections for that rule.
Behaving in this manner would change the code in which the server accepts connections. During the acceptance, the server would either: