M
M
Maxim2016-09-27 13:18:15
Mobile development
Maxim, 2016-09-27 13:18:15

How to open a site on localhost in a mobile browser?

There is a project on node.js, I have it running on localhost:3000 , can I somehow open it through a mobile browser? You need to debug, everything works fine in emulators, but not on a real device.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
aol-nnov, 2016-09-27
@aol-nnov

probably by hanging your craft on a real address on the network, and not on a localhost

E
evnuh, 2016-09-27
@evnuh

ngrok

S
sim3x, 2016-09-27
@sim3x

If you have a point on your laptop / PC, through which your phone enters
Then you take the ip of your wifi and open it on your mobile phone To
run your project on the node, you will need not on the localhost, but on the ip of your wifi stackoverflow.com/questions/31572332/ run-local-ser...
well, or 0.0.0.0 (but then it will be visible in the provider's network)

M
Mercury13, 2016-09-27
@Mercury13

If the mobile device does not use a proxy browser (Opera Mini and others) and hangs on the same radio point as the stationary device - 1) configure the radio point so that WiFi clients have access to the local network; 2) we raise a web server on a stationary computer. Access - http://192.168.1.2:3000/site, the internal IP address of the computer can be found with the ipconfig program; port (3000) is determined by the web server settings.
If either a proxy browser is used, or a smartphone is on the Internet through OpSoSa, you need to raise the web server and make it visible from the Internet. Either upload to the hosting, or forward the port on the router. Access - http://12.34.56.78:3000/site, external IP address can be found through 2ip.ru. Port (3000) depends on the port forwarding setting, and for security it is highly undesirable to make it standard 80, 3128 and 8080.
How to forward the port on the router - google it yourself; consists of two things: how to fix the IP and how to drive a new redirect rule into the NAT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question