如何访问Android设备本地主机的网站 [英] how to access a localhost website from android device

查看:112
本文介绍了如何访问Android设备本地主机的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的笔记本电脑与该地址的ASP.net的Web API:

I have an ASP.net Web API in my laptop with this address :

本地主机:99949

localhost:99949

我将它添加到IIS防爆preSS,我可以从同一个局域网其他计算机访问我的网站的API,并且它将会是:

I add this to IIS Express that I can access my web Api from another computer in same lan network , and it's going this:

Nimis:80

我可以访问其他电脑我的网络API,但是当我试图用我的Andr​​oid设备访问这个拿给我找不到网页的错误。

I can access to my web api from other PCs , but when I try to access this with my android device it show me "Web page not available" error.

我关掉我的所有的防火墙。

I turn off all my firewalls.

我应该怎么做才能解决这个问题?

what should I do to fix it ?

推荐答案

您需要在防火墙添加入站规则端口80(或任何端口用于您网站上的IIS):

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

之后,你应该能够使用 HTTP从其他设备访问您的网站在同一网络中://计算机(如< A HREF =HTTP:// myhomepc相对=nofollow> HTTP:// myhomepc )

然而,你可能需要与Android使用的服务器计算机的IP地址。它似乎总是覆盖使用谷歌的服务器的DNS条目。在这种情况下尝试修改DNS设置解释<一个href=\"http://android.stackexchange.com/questions/52140/how-to-reach-local-computer-via-machine-name-instead-of-ip\">here.

However you might need to use the IP of the server machine with Android. It always seems to override its DNS entries using Google's servers. In this case try to modify DNS settings as explained here.

这篇关于如何访问Android设备本地主机的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆