0
votes

I have installed browsersync using command npm install -g browser-sync in windows 10 x64. nodejs version 10.11.0 browsersync version 2.26.3

everything is working fine in desktop. but when i try to access http://192.168.56.1:3000 from mobile device using same wifi, i get "this site can't be reached"

i have installed another tool named dev-ip which returns this in powershell: [ '192.168.56.1', '192.168.0.120' ]

the ip series 192.168.0.120 used to work fine in my mobile devices.

now, how to use the ip 192.168.0.120 instead of 192.168.56.1 in browsersync globally?

2

2 Answers

0
votes

Just specify the host in your configuration that you want the server to run on.

Eg. In you case it would be host: "192.168.0.120"

You can refer to the link below for more information.

https://www.browsersync.io/docs/options#option-host

0
votes

Hi, guys. This is how it worked for me:

Source:

  • windows 10
  • all firewalls are closed
  • network access (from windows) to the PC is disabled
  • external url from gulp 192.168.56.1:3000
  • proxying local php site from OpenServer
  • external device - iphone safari/chrome
  • external (virtual) device - vwware with macos
  • make sure that Windows Defender firewall monitor in high-risk mode -> rules for incoming connections -> Node.js: Server-side JavaScript is enabled (and other necessary apps) enter image description here

Solution:

  1. look at what ip address in the home network my PC has (all devices are connected to the same network) - for example 192.168.1.103
  2. in the gulp file I specify it host: "192.168.1.103",
  3. save
  4. checking it out

Important:

  • for source - external device - iphone safari/chrome - correct url is only 192.168.1.103:3000
  • for source - external (virtual) device - vwware with macos - correct urls is 192.168.1.103:3000 and 192.168.56.1:3000 both

Visually in pic: enter image description here

Result:

Checked on all devices, in virtual devices, on the PC itself

  • browsersync works
  • the Internet is not lost
  • there is no address conflict within the network

Hope this will help someone too 🙂