1

I have my environment setup to listen to jetty on port 8888. However, for a limited time, I will have to also listen on 8889.

I though of using named pipes and nc for that:

mkfifo pipe1
/bin/nc -l 8889 0<pipe1 | /bin/nc localhost 8888 1>pipe1

I noticed that the port forwarding will only work for a certain amount of time, returning the prompt after.

Why is it only working for a certain amount of time?

Is there a better port forwarding mechanism I could use? All of this runs on my local machine, between the ports 8888 and 8889.

This is on a Ubuntu 14.04.

1 Answers1

0

An EOF may be killing it. The following may help:

In netcat - keep listening for connection in Debian the asker points out:

"There's -q -1 option to listen forever after EOF appears on stdin".

If you want to try to avoid the EOF try How to prevent terminating command to send EOF to named pipes?

Info5ek
  • 113