hiddentao / gulp-server-livereload

Gulp plugin to run a local webserver with livereload enabled via socket.io. Also comes with standalone command-line interface.
MIT License
93 stars 28 forks source link

HTTPS #30

Open kareljan opened 8 years ago

kareljan commented 8 years ago

When I make the server https, I get the following error.

Mixed Content: The page at 'https://localhost:8000/' was loaded over HTTPS, but requested an insecure script 'http://localhost:35729/livereload.js?'. This request has been blocked; the content must be served over HTTPS.

This is my config .pipe(server({ livereload: { enable: true, filter: function (filename, cb) { cb(!(/.(sa|le)ss$|node_modules/.test(filePath))); } }, https: true, fallback: "index.html" }));

hiddentao commented 8 years ago

The problem is in the code we assume HTTP, see https://github.com/hiddentao/gulp-server-livereload/blob/master/src/index.js#L131

I'll need to fix this to allow for https, perhaps with a config parameter.

hiddentao commented 8 years ago

Have made the change in 1.7.1. Please try again.

romamatusevich commented 8 years ago

For 1.7.1 there is other issue:

Failed to load resource: net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH https://localhost:35729/livereload.js?

Config: { https: true, livereload: true, open: true, proxies: config.proxies }

Environment: Browser: Google Chrome 46.0.2490.86 OS: Windows 7 Node.js: 5.7.0

hiddentao commented 8 years ago

Yep an SSL certificate is needed that matches localhost:35729. We'll need to update the code to serve out an SSL certificate.

ChristianWeyer commented 8 years ago

@hiddentao do you already have a timeline when you will be able to provide an SSL cert for the live reload server (port 35729) ? Thank you.

hiddentao commented 8 years ago

@ChristianWeyer Not at the moment I'm afraid - busy on some other projects. Actually I think what should be added is an option which allows you to specify where the SSL certificate sits. Then you can generate your own certificate. It would be a simpler fix too.

hiddentao commented 8 years ago

I'll see if I can look at this next week.

hiddentao commented 8 years ago

Should be fixed in 1.7.4. Please test it out and let me know.