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

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

问题描述

如何使用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是端口3000上的localhost. 对于外部用户,它将是外部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天全站免登陆