Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do i use browsersync with a reverse proxy #629

Closed
batwicket opened this issue Apr 27, 2016 · 2 comments
Closed

how do i use browsersync with a reverse proxy #629

batwicket opened this issue Apr 27, 2016 · 2 comments

Comments

@batwicket
Copy link

I'm using a reverse proxy (haProxy in this case). The proxy is also an SSL terminator.
frontend : https://localhost
backend : http://localhost:8080
I've tried setting the BrowserSync proxy target option to the frontend address, but it insists on bringing up the browser with https://localhost:3000. I'm missing something. Can anyone help?

@batwicket
Copy link
Author

I should probably add that BrowserSync appears to be intercepting button events. When i navigate the site using http://localhost:3000 the buttons work properly. When i switch to https://localhost the buttons do not work. Just an observation..

@batwicket
Copy link
Author

Modifying the proxy target address to "https://localhost" in tools/server.js works. When the browser comes up it displays the url of the BrowserSync proxy server which hooks browser actions and propagates them to other devices registered with BrowserSync. The proxy server forwards the http traffic to the reverse proxy. This isn't entirely transparent because if you try to switch the URL away from the BrowserSync proxy it seems that the events are still hooked so buttons don't work.

If you need CORs then problems occur because of the domain switching. You need to configure the BrowserSync proxy server i.e. https://hondo.wtf/posts/enable-cors-in-browsersync/ . I didn't actually do this so the BrowserSync forums might be best if you run into difficulty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant