How do I forward all data from one connection to another (NodeJS)?

I want a server to listen for a connection from 100.0.0.0:3000. When the connection occurs, it should then open up a new connection to 200.0.0.0:3000 and maintain exact data forwarding from the first connection to the second one.

Note, this is not HTTP.

I am not an expert with NodeJS's connection utilities, so the attempt I have is an error-fraught mess that's simply not working (I can show you if I like). I'm sure there is a simple way to do this. Thanks.

Check out this proxy: https://github.com/gonzalo123/nodejs.tcp.proxy/blob/master/proxy.js.

Really simple. Does the job :)

You could use HAProxy or IPTables to forward ports.