Search code examples
reactjsnetwork-programmingconnectionwifiip-address

Can't connect to my React app from my mobile device


I am having some issues connecting to my React app running on my PC from my mobile device. I remember being able to do it awhile back, but for some reason it's not working anymore.

Both devices are on the same WiFi network. I have mesh routers and I verified they are connected to the same one (not sure if that matters). I'm running Windows 11 and trying to connect from an Android device.

I'm getting a connection timeout when trying to connect to my app from my phone (ip address below is fake):

This site can't be reached

192.559.2.27 took too long to respond

Try:
Checking the connection

ERR_CONNECTION_TIMED_OUT

I verified that the ip address I'm trying to connect to is the correct one and I am attempting to connect to the right port. Any thoughts on what the issue might be or some settings I could check?


Solution

  • The answer here was to simply set my home WiFi network as a private network. Windows 11 sets the network type to "public" by default, which prevents it from being discovered by other devices on the network.

    1. On Windows 11, go to Settings -> Network & Internet -> Wi-Fi -> properties
    2. Change the Network profile type to private

    Obviously, you'll only want to do this on a trusted network and not a public Wi-Fi or anything.