Update: I've published a npm package for an even easier usage of this trick! See pascaliske/bsproxy.
Quickly proxy a local domain (e.g. http://my-site.dev
) for local network access.
-
Globally install BrowserSync
$ yarn global add browser-sync
OR
$ npm i -g browser-sync
-
Copy the script
bsproxy
to your binaries folder (/usr/local/bin
)$ curl -L https://gist.github.com/pascaliske/2d37fe363ecea49e3835ba7dbda31ef9/raw/bsproxy >> /usr/local/bin/bsproxy && chmod +x /usr/local/bin/bsproxy
-
Run the command
$ bsproxy http://my-site.dev
- If BrowserSync doesn't show you your correct ip, you have to manually replace localhost with your ip in your local network
$ bsproxy http://my-site.dev 8080