Closed losyn closed 11 months ago
can you describe what the issue is precisely ?
After using the above code to execute, I was unable to connect to the target service using a shell
I think it is because your server does not implement the SSH protocol
hum actually the issue is that you are loosing packets and you should pause the server socket from reading buffers until you are connected with the NetClient, your code should look like:
vertx.createNetServer().connectHandler(server -> {
server.pause();
vertx.createNetClient().connect(22, "192.168.10.211", event -> {
if (event.succeeded()) {
vps.put("xxxxx", new Vps(server, event.result()).proxy());
server.resume();
} else {
event.cause().printStackTrace();
}
});
}).listen(10022, tcp -> {
if (tcp.succeeded()) {
System.out.println("proxy:10022");
promise.complete();
} else {
promise.fail(tcp.cause());
}
});