1

I am using a React client and a node js server (MERN Stack). The server runs good on my pc but when i try to connect from my mobile phone to the ipv4 of my pc with the correct port I am unable to send requests to the server. I tried to change the proxy of the React app but it doesn't seem to work. Do you know what the problem might be? Thanks.

Itik
  • 340
  • 2
  • 10
  • 1
    did you tried something like https://stackoverflow.com/a/8326300/6658955 ? or this https://stackoverflow.com/q/47412363/6658955. Usually you have to change the host ip from 127.0.0.1 to 0.0.0.0 in order to expose the por to external clients (outside the same machine) – UselesssCat Feb 21 '22 at 21:13
  • 1
    I tried what you said and added another thing and it works now. Thanks. – Itik Feb 22 '22 at 16:01

1 Answers1

1

That could be a network issue if your are trying to access your PC from an external IP (Phone not connected to local network, wifi), for example the PC connected to a router that does not forward external traffic to it.

If you can, try connecting your phone to the same network via wifi and access the local IP:PORT instead of ipv4.

  • That's what I tried to do but maybe I will try to restart my router and try again. Thanks. – Itik Feb 21 '22 at 21:04