title: NodeJS - create simple forwarding server
body: <p>I'm trying to create a simple nodejs server to server program.</p>
  
  <p>Here's what I'm trying to achieve:</p>
  
  <pre><code>-----------¦remote¦-----satellite link-----¦core¦---------
  port 6999                port 7000                 port 6999
  </code></pre>
  
  <p>I need to write node.js code for both 'remote' and 'core'.</p>
  
  <p>Here's what I have sofar (I'm a very confused now...):</p>
  
  <pre><code>//remote.js
  var util=require('util');
  var net=require('net');
  
  var input=net.createServer(function(inputStream){
          inputStream.on('data', function(data) {
                  util.puts(data);
          });
          var output=net.createServer(function(outputStream) {
                  outputStream.pipe(inputStream, {end: false});
  
                  outputStream.on('data',function(dta){
                          util.puts(dta);
                  });
          });
          output.listen(7000, '172.16.1.224');
  });
  input.listen(6999, '172.16.1.224');
  </code></pre>
  
  <p>Once I have these two forwarding modules (remote and core) up-and-running, I'm hoping to do some packet inspection...</p>
  
  <p>Many thanks in advance,</p>