Using Browser Sync

Hello,
I am using VS Code to develop WordPress website. I’ve installed the browser sync extension. When I add the .local url it doesn’t work. It goes to port 3000. Is there a way to configure Local to use browser sync or any other option for browser refresh on save?

Thank you.

BrowserSync is a great tool, and due to the way it is built, it will always have that port added to it.

This is because BrowserSync is basically a proxy that “sits in front of” the Local site and gives you a bunch of extra tooling like auto-refresh styles, syncing js events, etc.

Because of this, you’ll need to turn on Local so that the site gets built, and then start BrowserSync as well. You should be able access the site from both urls:

- `example.local`  <-- Directly connect to the Local site
- `localhost:3000` <-- Connect to the site through the BrowserSync proxy

Hi @ben.turner, I am trying to setup browsersync aswell and I cant get it working under the “.local” Domain. So when I open localhost:3000 it works fine, but I want it to work on the website.local-url as well, because that way the ssl certificate also works and I can access wp-admin and stuff, which doesnt work with the localhost:3000

Hi @NikolaiLehbrink

This might be useful in your troubleshooting: