gulp-livereload over https?
Although not in the API docs adding key/cert parameters works
gulp.task('run-reload-server', function() {
livereload.listen({
host: "my.domain.com",
port: 35729,
key: fs.readFileSync(path.join(__dirname, 'livereload.key'), 'utf-8'),
cert: fs.readFileSync(path.join(__dirname, 'livereload.crt'), 'utf-8'),
});
});
There are two solutions off the top of my head:
1. Host the client yourself
https://github.com/livereload/livereload-js
Install it as a dependency:
bower install livereload-js --save-dev
or
npm install livereload-js --save
Then just include it like you include a regular script. However be aware of these caveats.
/path/to/dist/livereload.js?host=localhost
2. Proxy the client script
This is pretty involved but it would definitely work. Create an HTTPS server in your gulpfile (perhaps in the watch task).
https://github.com/nodejitsu/node-http-proxy
https://github.com/nodejitsu/node-http-proxy#using-https
httpProxy.createServer({
ssl: {
key: fs.readFileSync('valid-ssl-key.pem', 'utf8'),
cert: fs.readFileSync('valid-ssl-cert.pem', 'utf8')
},
target: 'https://localhost:35729',
secure: true // Depends on your needs, could be false.
}).listen(443);
Then you can reference the proxied script.
https://127.0.0.1:443/livereload.js?snipver=1