How do I use vagrant and browsersync with local domain?

Here’s how I got it working.

I added port forwarding to vagrant and then I launch browser-sync from within the vm. Everything works now at http://example.dev:3000 and http://example.dev:3001.

Here’s what I added to my Vagrantfile:

config.vm.network :forwarded_port, guest: 3000, host: 3000, auto_correct: true
config.vm.network :forwarded_port, guest: 3001, host: 3001, auto_correct: true

Leave a Comment

tech