How localhost address on the local network

1

I'm testing a web application locally by pc and mobile, I connect to the pc using http://localhost and by mobile link . And I wonder if you can change the host address to a fixed address (for example link ), so that I can access from any device without having to get the server ip (I'm using Xampp).

Thank you in advance.

    
asked by anonymous 17.08.2015 / 19:23

1 answer

4

Local Area Network (LAN) Access

If you are on the same network you can use the server name . To find the computer name in Windows open Prompt Command and enter hostname :

InmycaseitisDEV004W,sojustaccessusingthishostnameoverthenetwork:

http://dev004w/

Onenoteisthatyourapplicationcannotreferenceresourcesaslocalhost,eg

<linkrel="stylesheet" href="http://localhost/estilo.css">

This will cause an error because you are looking for the estilo.css file on the machine you are accessing, then refer to the IP or hostname

Internet access (WAN)

If you are not on the same network of the server (machine running XAMPP / Wampp / IIS / Apache) you can use NO-IP . It is a service that provides a free DNS for dynamic IPs.

    
17.08.2015 / 19:43