在移动设备上连接多个本地站点

时间:2015-11-14 13:35:38

标签: mobile xampp virtualhost

我有多个本地站点,我在本地计算机上开发。

我希望能够在移动设备上访问它们,因为它们仍在我的机器上本地。

使用XAMPP这些是示例vhosts配置:

<VirtualHost *:8080>
    DocumentRoot "C:/design and photos/agency1/website/public_html"
    ServerName agency1dev.com
    <Directory "C:/design and photos/agency1/website/public_html">
        Options All
        AllowOverride All
        Require all granted         
    </Directory>
</VirtualHost>

<VirtualHost *:8080>
    DocumentRoot "C:/design and photos/captives/website/public_html"
    ServerName capdev.com
    <Directory "C:/design and photos/captives/website/public_html">
        Options All
        AllowOverride All
        Require all granted         
    </Directory>
</VirtualHost>

Windows主机文件

127.0.0.1    agency1dev.com
127.0.0.1    capdev.com

我知道我可以使用我的机器IP地址达到例如:

http://196.168.2.3:8080

但这是XAMPP目录,所以,我如何访问,例如agency1dev.com

这可能吗?

2 个答案:

答案 0 :(得分:1)

您可以尝试使用Finch,https://meetfinch.com

它非常易于使用(最近为它发布了一个GUI),并且只是“工作”和#39;无需做任何事情。

完全披露:我参与了该项目。

答案 1 :(得分:0)

我找到的解决方案是使用NGROK

非常容易实施:

In cmd or some shell

Go to: C:\path\to\ngrok

Type:

ngrok http -host-header=myapp.dev 8080

Change myapp.dev to suit what you want to look at - and change port (8080) accordingly

Then look at output and it will give you a http and https url to navigate to on your device

Simple!