-1

Working on React-Native project and something is going wrong. When the node is up, I can connect to it using the IP address 192.x.x.x:8081/index.js from PC. For development on phone, I need to connect to the same server from iPhone and the server doesn't respond despite when I connect from the same PC it loads immediately. Both phone and PC are connected to the same Wi-Fi. When I use

sudo lsof -i 

I get

COMMAND PID USER  FD  TYPE   DEVICE           SIZE/OFF  NODE NAME

node 5420  user  46u  IPv6 0x.....(corrected this)  0t0  TCP *:sunproxyadmin (LISTEN)

What i get from this message is that somehow, my server is IPv6 type and have IP address - *:sunproxyadmin (am I right?). I don't understand what to do with this and how to achieve loading server from other devices. Help please! May be the issue lies in that I use wrong IP address 192.x.x.x when starting the server. If that is true where I can find the right one? Should it be equal to Router IP or DNS?

From Mac OS I'm connected with Wi-Fi USB and from iPhone I'm on the same network. There is a difference in Ip addresses displaying at Mac and iPhone. Mac shows 192.x.x.x03 and iPhone shows 192.x.x.x01. Router IP and the DNS are the same.

Daniil Kunin
  • 143
  • 1
  • 12

1 Answers1

0

Are you connecting to the server via localhost on your PC? 192.168.0.1? If so, find out the local ip address of your PC and connect to that with your iPhone. Use nginx or something to proxypass to your node server.

  • I have a file in node_modules that I've been said to change to start server from the ip I declared. I used all the variants (My PC ip, iPhone ip). I can only open it from PC. So if I declared IP of my PC - 192.x.x.x03 it will render from PC. And If i open the same in phone browser it will say "Can't reach the site' – Daniil Kunin Feb 09 '19 at 06:37