I’ve been able to set up sending and listening to http requests locally using 127.0.0.1:8000. I want to try doing it using the internet now.
I have a VPN with port forwarding enabled, but sending requests to that IP address and port does not yield a response like it did when doing it locally.
Can anyone clarify which address I should be listening on in order to receive http requests from the internet? I tried 0.0.0.0 and a few inet addresses from ip add
, but none of them work.
Assuming your vpn provides a stable remote IP, your client connection needs to use that. Try “whatsmyip” or similar over the vpn. The remote address almost certainly won’t appear in the local output of
ip a
.Locally, listen on the “this host”, 0.0.0.0.
You may need to check your firewall locally.
You don’t need to run your http service to troubleshoot - simple tools like netcat can listen for incoming requests -
nc -l 0.0.0.0 8000
or what-have-you.Finally: you might want to look at using a shell host as the client rather than targeting your vpn ip from your local host, just to take hairpin connections out of consideration when troubleshooting.