Simple TCP proxy in Vert.x using Pump class (JAVA)
asynchronous, java, proxy, tcp, vert.x
Solution
I just was missing to start the pumps. Then it worked.
Pump.createPump(socket, cliSocket).start();
Pump.createPump(cliSocket, socket).start();
Problem
I would like to realize a proof of concept TCP transparent proxy in Vert.x. Requirement A verticle that listens on port X and when somebody connects and sends data it opens a client connection towards a preconfigured TCP server. From this moment until any of the peers closes the connection, a bidirectional channel is kept and data flows up and down the channel from client to server and viceversa. Here's my attempt which is not working. ``` vertx.createNetServer().connectHandler(new Handler<NetSocket>() { public void handle(final NetSocket socket) { vertx.createNetClient().connect(6367, "localhost", new Handler<NetSocket>() { @Override public void handle(NetSocket cliSocket) { Pump.createPump(socket, cliSocket); Pump.createPump(cliSocket, socket); } }); } }).listen(3000); } ``` At least this is how I understood the meaning of the Pump class: http://vertx.io/core_manual_java.html#pump Where's my error?