Comments (5)
@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?
from toxiproxy.
@miry I will try to supply a working example.
from toxiproxy.
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"?> <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:neconf:base:1.0</capability> <capability>urn:ietf:params:netconf:base:1.1</capability> <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability> <capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04</capability> </capabilities> </hello>
Then form cywin I start ssh from command line :
ssh -i idkey netconf@localhost -p 57115 -s netconf < rpc.xml
Then I get the following output.
Warning: Identity file idkey not accessible: No such file or directory.
The authenticity of host '[localhost]:57115 ([::1]:57115)' can't be established.
RSA key fingerprint is SHA256:4dfREFhjQJ9Mpv1PJOJHaM2n0NTM4oJLoLIx8z+xAJU.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:22: [localhost]:53619
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[localhost]:57115' (RSA) to the list of known hosts.
Interactive SSH Authentication
Type your password:
(netconf@localhost) Password:
urn:ietf:params:netconf:base:1.0urn:ietf:params:netconf:base:1.1urn:ietf:params:netconf:capability:writable-running:1.0urn:ietf:params:netconf:capability:candidate:1.0urn:ietf:params:netconf:capability:rollback-on-error:1.0urn:ietf:params:netconf:capability:validate:1.1urn:ietf:params:netconf:capability:startup:1.0urn:ietf:params:netconf:capability:xpath:1.0urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&also-supported=report-all,report-all-tagged,trim,expliciturn:ietf:params:netconf:capability:notification:1.0urn:ietf:params:netconf:capability:interleave:1.0urn:ietf:params:xml:ns:yang:ietf-yang-metadata?module=ietf-yang-metadata&revision=2016-08-05urn:ietf:params:xml:ns:yang:1?module=yang&revision=2017-02-20urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&revision=2013-07-15urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&revision=2013-07-15urn:ietf:params:netconf:capability:yang-library:1.1?revision=2019-01-04&content-id=32urn:sysrepo:plugind?module=sysrepo-plugind&revision=2020-12-10urn:ietf:params:xml:ns:yang:ietf-netconf-acm?module=ietf-netconf-acm&revision=2018-02-14urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2013-09-29&features=writable-running,candidate,rollback-on-error,validate,startup,url,xpathurn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?module=ietf-netconf-with-defaults&revision=2011-06-01urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&revision=2012-02-06urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&revision=2010-10-04urn:ietf:params:xml:ns:netconf:notification:1.0?module=notifications&revision=2008-07-14urn:ietf:params:xml:ns:netmod:notification?module=nc-notifications&revision=2008-07-14urn:ietf:params:xml:ns:yang:ietf-x509-cert-to-name?module=ietf-x509-cert-to-name&revision=2014-12-10urn:ietf:params:xml:ns:yang:iana-crypt-hash?module=iana-crypt-hash&revision=2014-08-061]]>]]>Connection to localhost closed by remote host.
This works fine!
Note: check log for port , "mapped port for netopeer2"
Then when try to connect to toxiproxy I get the following:
$ ssh -i idkey netconf@localhost -p 57094 -s netconf < rpc.xml
Warning: Identity file idkey not accessible: No such file or directory.
kex_exchange_identification: Connection closed by remote host
Connection closed by ::1 port 57094
Note: check the log for port, mapped port for toxiproxy 57585
I am expecting that I could connect to toxiproxy port and the created, ToxiProxy in ToxiProxyTest and get the same result back as with the netopeer2.
What am I missing?
Eclipse project to execute with Docker Desktop running.
toxiproxy.zip
//mike
from toxiproxy.
@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.
from toxiproxy.
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.
from toxiproxy.
Related Issues (20)
- Fails to connect after peer-reset HOT 6
- ToxiproxyContainer.ContainerProxy deprecated HOT 3
- How to proxy MTLS connections using Toxiproxy HOT 1
- Create a toxic, connection loss, for Server --> Client ( donwstream)? HOT 13
- Migrate the GH default branch to main HOT 1
- Reopen all the PRs that were closed unintentionally because of master -> main rename HOT 2
- RemoveToxic: HTTP 503: Unexpected response code, expected 204 HOT 5
- Possible to add toxics in config? HOT 1
- non-local API server connection refused when using '-config' HOT 1
- Dynamic / Conditional Toxics? HOT 2
- Tag and release v2.6.0? HOT 2
- panic: runtime error: slice bounds out of range [808:773]
- Difficulty Implementing Proxy for OpenAI API with App Calling and curl Insufficiency
- Proxy does not foward custom HTTP headers
- Unable to update toxic using prebuilt windows server
- Documentation for distribution of latency with different jitter values
- Is Redis Cluster/ PostGresDB Connection(based on master/slave architecture) supported for ToxiProxy ?
- Toxiproxy control port hangs on removing a toxic HOT 2
- Release toxiproxy changes
- Support or simulate packet lose in Toxiproxy?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toxiproxy.