DEV Community

Discussion on: What's my local internet address?

Collapse
 
ingosteinke profile image
Ingo Steinke, web developer

If you only need to access you localhost server from other devices for cross-device testing, you don't need a shared internet connection at all. You can open a hotspot on the device running the server and connect the other devices to that specific hotspot network.

In most operating systems, there is a built-in hotspot option in the network settings, and opening a hotspot will temporarily break the connection to your wifi router as a usual networking device can only manage one wifi connection at the same time. This will also change your local IP address(es).

In my example, after opening a hotspot, inet 192.168.1.170 is gone, instead there is inet 10.42.0.1 which can be accessed by deviced connected to my computer. And this time it's also password protected by default. Nice! And if we need both the local connection and actual internet (and we're not on a train) we can use a cable connection (via Ethernet cable to the router or USB tethering with a phone connected to a mobile service provider).

Screenshot: Wi Fi Hotspot - switch off to connect to a network