本地开发时在移动设备中同步浏览器 [英] Browser-sync in mobile while local development

查看:14
本文介绍了本地开发时在移动设备中同步浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 gulp Browser-sync 在手机中查看本地开发网站?我在手机浏览器中输入 localhost:3000 但它不会加载

How can I view my local dev website in my phone using gulp Browser-sync? I type localhost:3000 in my phones browser but it won't load

推荐答案

当你在终端运行 gulp 时,你应该会看到:

When you run gulp in your terminal you should see :

    [BS] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://192.168.10.81:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.10.81:3001

这意味着您的本地 URL 是 localhost 的 3000 端口.对于外部用户,它将是外部 IP [不是 UI ].要从您的手机访问,您需要在手机浏览器中输入外部 IP 及其端口.

What it means is that your local URL is localhost at port 3000. For external users it will be the external IP [ not the UI one ]. To access from your phone you need to enter the External IP along with its port in your phone's browser.

您可以通过访问 UI IP 查看所有浏览器同步设置.

You can view all your browser-sync settings by visiting the UI IP.

注意:要在您的手机上使用外部链接,您的手机和计算机应该在同一个 Wi-Fi 网络上,然后才能使用.

这篇关于本地开发时在移动设备中同步浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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