On 7/01/2019 16:58, Richard Hodges wrote:
The network stack can only bind an acceptor (underneath it's a socket) to an address currently mapped into the IP network stack of the machine, docker container or VM - depending on where you are running it.
On many hosting services, the external (visible to the world) IP address is not actually on the same machine on which you are running your application. There is usually a facility to map/route the external IP address and port onto the private IP address of your application server.
If you're running it on a home (or small office) network, then it is typically your Internet router which actually "has" the external IP; you will need to configure port forwarding in this device to map a port from the external IP to a port on an internal-network IP. Bear in mind that your ISP may have restrictions against (and might block, especially if they are doing another layer of NAT) servers hosted in a home network -- especially in-development ones; and of course there are security concerns with doing so as well. And home external IPs are dynamic, so will change from time to time, making them awkward to use long-term.