Organizational Research By

Surprising Reserch Topic

node js forward all traffic from port a to port b


node js forward all traffic from port a to port b  using -'javascript,node.js,portforwarding'

I'm trying to forward all traffic from port 6999 to port 7000 (I know I could use iptables, but the idea is to use Node.js to do some packet inspection).

Here is the code I have sofar:

var net=require('net');
var compress=require('./node-compress/compress');

var ip='172.16.1.224';
var ipPort=6999;
var opPort=7000;

var output=net.createServer(function(connOut){
        var input=net.createServer(function(connIn){
                connIn.pipe(connOut);
        });
        input.listen(ipPort,ip);
});
output.listen(opPort,ip);


It just does not seem to work. When I do a tcpdump on port 7000, nothing shows up. Anyone have any suggestions?

Many thanks in advance,
    
asked Sep 18, 2015 by shegokar.anjeet
0 votes
43 views



Related Hot Questions



Government Jobs Opening


...