title: Simple TCP proxy in Vert.x using Pump class (JAVA)
body: <p>I would like to realize a proof of concept TCP transparent proxy in Vert.x. </p>
  
  <h2>Requirement</h2>
  
  <p>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.</p>
  
  <p>Here's my attempt which is not working.</p>
  
  <pre><code> vertx.createNetServer().connectHandler(new Handler&lt;NetSocket&gt;() {
          public void handle(final NetSocket socket) {
              vertx.createNetClient().connect(6367, "localhost", new Handler&lt;NetSocket&gt;() {
  
                  @Override
                  public void handle(NetSocket cliSocket) {
                      Pump.createPump(socket, cliSocket);
                      Pump.createPump(cliSocket, socket);
  
                  }
              });     
      }
      }).listen(3000);
  }
  </code></pre>
  
  <p>At least this is how I understood the meaning of the Pump class:</p>
  
  <p><a href="http://vertx.io/core_manual_java.html#pump" rel="nofollow">http://vertx.io/core_manual_java.html#pump</a></p>
  
  <p>Where's my error?</p>