Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

browser-sync cannot proxy https-websites

I use browser-sync 2.11.1 with OS X Chrome 48.0.2564.97 (64-bit)

When I use it as a proxy for http-website:

browser-sync start --proxy http://example.com

it works great and I can point multiple browsers to localhost:3000 so that actions done in one of them are replicated in others.

However when I use it for https-website:

browser-sync start --proxy https://twitter.com

it doesn't work. When I point browsers to localhost:3000 they do not show up in "Current Connections" of browser-sync UI and also the actions are not replicated between them.

Maybe it has something to do with my browser complaining about https: https-error

Is there a bug in browser-sync or am I missing something?

like image 308
wheleph Avatar asked Feb 02 '16 18:02

wheleph


People also ask

How does BrowserSync proxy work?

How Does BrowserSync Work? BrowserSync starts a small web server. If you're already using a local web server or need to connect to a live website, you can start BrowserSync as a proxy server. It injects small script into every page which communicates with the server via WebSockets.

How do I change browser browser sync?

In Sublime Text 3 go to Preferences -> Browse Packages... Open 'Browser Sync' folder and edit the browser property in browser_sync_launch. js file. Save this answer.

What is BrowserSync used for?

The BrowserSync is used to watch all HTML and CSS files in the css directory and performs the live reload to the page in all browsers whenever files were changed. BrowserSync makes workflow faster by synchronizing URL's, interactions and code changes across multiple devices.


1 Answers

Apparently https://twitter.com is just a bad example. When I try https://about.gitlab.com/ the synchronization between my browsers does work:

browser-sync start --proxy https://about.gitlab.com/ --logLevel debug

According to the maintainer of browser-sync:

any large site like twitter has multiple techniques in place to prevent proxing like this - and rightly so.

Browsersync is a development tool to be used on local addresses that you're working on - in those cases it will work fine with HTTPS - you'll just have to click accept on the warning about self-signed certs :)

like image 87
wheleph Avatar answered Nov 11 '22 14:11

wheleph