Closed mpet closed 1 year ago
@mpet Sorry but I could not fully understand the problem. Can you share an example how it could be reproduced with docker compose/containers or shell scripts?
@miry I will try to supply a working example.
Hi again,
Prequesites: Docker Desktop or similar.
I start the provided example and put a breakpoint in class ToxiProxyTest line 58.
netopeer2Proxy.toxics().resetPeer("reset-peer-down", ToxicDirection.UPSTREAM, 10);
Then when it is running. I first try to connect to the mapped port for the Netopeer2 server.
The rpc.xml contains:
`<?xml version="1.0" encoding="UTF-8"?>
@miry I found the issue in my code:
I had this line:
netopeer2Proxy = toxiproxyClient.createProxy("netopeer2", "localhost:8666", "localhost:"+netopeer2.getMappedPort(830));
The line should be:
netopeer2Proxy = toxiproxyClient.createProxy("netopeer2", "0.0.0.0:8666", "localhost:830");
It is a bit confusing that for listener that localhost does not work but it is ok for the upstream.
The upstream is how Toxiproxy can reach service. It could be that the service was available by 0.0.0.0:830. For listener it is what would be available for other services. If the clients located on another machine, then those could not reach Proxy.
@mpet I am glad that you found the problem. I am going to close the issue.
Hi,
I have setup toxiproxy for java in project so we can get the same ip and port and don't have to restart our server but only the proxy.
We use a java client and then ToxiProxy and Netopeer2 (both containers).
I setup using java and then I print the ports to make sure we setup correct.
2022-11-15 12:07:37,015 INFO : Netopeer2 mapped port 51579 2022-11-15 12:07:40,506 INFO : ToxiProxy mapped port 51608
Then we try to connect:
Could not connect to localhost:51608 using SSH.
We are using trilead ssh2 java library to connect ( it works fine wo toxiproxy).
I checked the stacktrace then could see that the following could be performed
So we could establish a tcp connection.
But then it fails in:
/* Parse the server line and say hello - important: this information is later needed for the
for later use. */
Within this method it fails on:
Do you know what could be the issue here?
br
//mike