Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am currently working on a webapplication which uses node.js and socket.io. Socket.io need to start a small tcp on port 843 for delivering crossdomain.xml's for FlashPlayers socket connections. As port 843 < port 1024 the node process must run as a root process, which is something I want avoid. Are there any possibilities to forward this port to another port. E.g.: Connection comes in on port 843 and is handled by a process listing to port 3000?

My first guess was to use iptables, but I am quite unfamiliar with it so I asked here for more information and a hint if I am looking in the right direction. If this could be suitable for my problem, are there any performance issues when using iptables?

share|improve this question
add comment

1 Answer

Sure, you could use iptables to do that. Here's an example one-liner:

# iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 843 -j REDIRECT --to-ports 3000

There shouldn't be any practical performance hit since afaik that redirect is all handled in the kernel.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.