简体   繁体   English

无法从 android 模拟器连接到 localhost

[英]Can't connect to localhost from android emulator

Im running asp webapp on my local machine and am trying to access the same site from an android emulator.我在我的本地机器上运行 asp webapp,并试图从 android 模拟器访问同一个站点。

I've tried changing the proxy settings to my local ip and 10.0.2.2 As well I've tried to connect directly to my local ip with still no luck.我尝试将代理设置更改为我的本地 ip 和 10.0.2.2 我也尝试直接连接到我的本地 ip,但仍然没有运气。

Any input would be greatly appreciated;任何投入将不胜感激;

It can be really painful to get this working.让这个工作真的很痛苦。

You have to open up fire walls, and config IIS express - and you don't have the full IIS GUI for setup.您必须打开防火墙并配置 IIS express - 而且您没有完整的 IIS GUI 进行设置。 So, by default, when running from Visual Studio, to get external use of that same web site can be REALLY a pain - a HUGE pain.因此,默认情况下,当从 Visual Studio 运行时,要在外部使用同一个网站可能真的很痛苦 - 一个巨大的痛苦。

Best bet would be to install the full edition of IIS on your computer - and not use IIS express.最好的办法是在您的计算机上安装完整版的 IIS - 而不是使用 IIS express。

There are some ideas and suggesting here on how to open up IIS Express.这里有一些关于如何打开 IIS Express 的想法和建议。

Visual Studio 2017 - Giving remote users access to website in IIS Express Visual Studio 2017 - 允许远程用户访问 IIS Express 中的网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM