3
Okay, so I'm semi-new to networking and to back-end web development, and am learning Flask presently.
I just turned on a basic little HTTP server on my laptop ("Hello World!") and am running it on port 5000. If I go to 127.0.0.1:5000 in my browser, I see the message correctly.
And if (on another computer in the house) I go to 192.168.1.40:5000, the private IP of the computer being used for the server, then I can see it from there, too.
But what if I want a friend to be able to access it from outside the local network, from far away? How do they find it?
I asked google what my IP (IPv4) was and tried using that, but as I expected it didn't work, since (as I understand it) that just resolves to the router itself, not necessarily the particular computer running the server. What am I doing wrong here?
OH IS THAT WHAT PORT FORWARDING IS? I've wondered that forever. – temporary_user_name – 2015-01-09T04:29:38.023
Yes, that's for that purpose specifically. Please also note that some ISP block certain ports (i.e. 25, 80), but if you use something like 5000, then you should be fine. – nochkin – 2015-01-09T04:31:18.350
Do real web servers use port forwarding or do they have a much more complex hardware setup custom configured for receiving incoming traffic? – temporary_user_name – 2015-01-09T04:33:00.203
They usually have public IP directly assigned so they don't need to forward anything. There are also load-balancers where they use something similar to port forwarding but more complex. – nochkin – 2015-01-09T04:34:25.023
Lastly, I don't NEED a static IP, right? Only if I really intend for this to stay up and be usable long-term. If I'm just playing around tonight, it doesn't matter, correct? And what about what this other guy is saying about a firewall rule? Sorry to have so many questions. – temporary_user_name – 2015-01-09T04:35:59.967
Correct. Static IP is to "protect" your IP from changing from time to time. But if you are willing to give your friend a new updated IP whenever it changed, then you are fine with this approach. – nochkin – 2015-01-09T04:38:55.510