I am deploying a closed source service. However, due to some restrictions, its listening port can only be bind to on some port on 127.0.0.1
. So, I cannot customize its code.
In the following, I am using Python's HTTP server as an example.
python -m http.server --bind 127.0.0.1 8800
Now, only this computer can access this service.
However, I want to make everyone who can access this computer, can access this service. Just like:
python -m http.server --bind 0.0.0.0 9999
Many similar problems suggested that I use SSH forwarding to solve them.
ssh -g -L 9999:localhost:8800 -f -N [email protected]
But ssh will encrypt the data, and sshd decrypt. I'm forwarding between the same computer. Encryption and decryption are just a waste of time and resources.
Some other problems point out that I can use a reverse proxy, such as Nginx. But I don't know what protocol this service uses (maybe UDP, or TCP but no HTTP on upper layer), I don't know if Nginx work with this non-HTTP protocol. Besides, my supervisor didn't allow me installing additional software.
So, is there anyway to solve this by using iptables
, or any programs commonly installed in most linux distributions? Thank you.