2015-12-26 148 views
0

当我的android应用程序连接到我的项目wampserver 10.0.0.2:8080时,我可以连接到localhost:8080,但我使用laravel,并且我的web服务位于localhost:8000 。我想从模拟器连接到IP 10.0.0.2:8000中的laravel服务器中的Web服务,但我无法连接到它。如何将模拟器连接到laravel服务器localhost:8000

10000毫秒后无法连接到/10.0.2.2(端口8000)。 我试过localhost:8000和其他IP,哪个IP用来连接laravel服务器?

回答

0

有点晚了,但你的问题与你的路由有关。首先,假设你使用的是Windows去你的hosts文件,并映射IP:10.0.2.2127.0.0.1

像这样:

127.0.0.1 10.0.2.2 

然后,如果你已经配置了你虚拟主机的IP 10.0.2.2映射到你的项目目录在你的的httpd-vhosts.conf

像这样:

<VirtualHost *:80> 
    DocumentRoot "C:/www/example/" 
    ServerName 10.0.0.2 
    ServerAlias 10.0.0.2 
</VirtualHost> 
相关问题