Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access local host website in Android device through wifi

I am developing one website which is need to host in local system and access this website in all device through WiFi. My system in which I publish website in IIS is Connected in LAN. And WiFi is also from same router.

I need to access this website in all device which is connected in WiFi. How can I achieve this? If you have any other suggestion to do this than than please let me know.

like image 572
user3410950 Avatar asked Jun 05 '14 07:06

user3410950


People also ask

How can I access my localhost website from another network?

You are accesing localhost , meaning you have a web server running on your machine. To access it from Internet, you need to assign a public IP address to your machine. Then you can access http://<public_ip>:<port>/ . Port number is normally 80.

How do I access localhost from another device?

You can access your host machine with the IP address "10.0. 2.2". This has been designed in this way by the Android team. So your webserver can perfectly run at localhost and from your Android app you can access it via "http://10.0.2.2:8080".

What is localhost on my wifi?

In computer networking, localhost is a hostname that refers to the current device used to access it. It is used to access the network services that are running on the host via the loopback network interface. Using the loopback interface bypasses any local network interface hardware.


1 Answers

You need to add an inbound rule in the firewall for port 80 (or whatever port you used for your website on IIS):

  • Go to Control Panel, Windows Firewall
  • Select Inbound Rules
  • Add a New Rule
    • Select "Port" as a Rule Type
    • Select "TCP and put "80" (and any other ports you want to open) in "Specific local ports"
    • Select "Allow the connection"
    • Select the network location where the rule should apply
    • Give a name and an optional description

After that you should be able to access your site from other devices in the same network using http://computername (e.g. http://myhomepc)

like image 194
user2316116 Avatar answered Oct 23 '22 11:10

user2316116