141
rated 0 times
[
147]
[
6]
/ answers: 1 / hits: 29311
/ 13 Years ago, mon, june 27, 2011, 12:00:00
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,
More From » node.js