I am running a flask server on my remote machine on the same network, whose IP is 192.168.1.11. Hence the flask server endpoint for the networks should be 192.168.1.11:5000
where 5000 is the default port chosen by flask.
However, when I hit a request from my local machine (IP: 192.168.1.10) to 192.168.1.11:5000
it doesn't return anything.
However when I run the following on my local machine (IP: 192.168.1.10) ssh -L 4000:127.0.0.1:5000 user@192.168.1.11
and then hit localhost:4000
, it works. I understand that this is Local Port Forwarding in ssh.
But when I run jupyter notebook
on the remote machine, it runs on the 192.168.1.11:8890
. Then when I run 192.168.1.11:8890
from my local machine, it works.
Why does jupyter work and not flask via the default configs? Is it because jupyter does some sort of remote ssh port forwarding. How do I run some code i.e. that is some configs, etc like ssh -R xxxx:xxxx:xxxx xxxx
.