gruntjs - grunt watch no longer refreshes Chrome when using custom open connect config via https -
i started new yo angular
scaffolding , tried configure grunt-contrib-connect open custom ssl domain name instead of localhost:9000. custom domain proxy_pass'd https://api/
http://localhost:9000
using nginx.
grunt-contrib-connect , grunt-contrib-watch updated 0.7.1 , 0.6.1, respectively.
the new setting works fine on initial launch (grunt serve
), html/css/js/etc changes no longer trigger browser reload. else need change? console shows change detected browser not refreshed.
full gist of gruntfile.js original , modified versions.
...snipped... // actual grunt server settings connect: { options: { port: 9000, // change '0.0.0.0' access server outside. hostname: 'localhost', livereload: 35729 }, livereload: { options: { // default: open: true, // modified custom target open: { target: 'https://mydomain.dev' } base: [ '.tmp', '<%= yeoman.app %>' ] } } } ...snipped...
looks main issue livereload.js file attempting loaded port not ssl enabled. how can configure watch or connect serve file without port?
maybe technique of injecting script not compatible running https nginx proxy_pass connect app? how rid of port? serve-able without port?
livereload.js setup websocket connection same host js served from, you'll need configure nginx websocket proxying. http://nginx.org/en/docs/http/websocket.html sounds websocket doesn't exist, since you're not seeing reload (but see js load ok). i've noticed in grunt-watch it'll output it's reloading file, if there connected client (you'll still see output file changed, not ... reload path/to/file ...
lines.
from i've seen in grunt-contrib-watch , tiny-lr repos on github, livereload.js should attempting make websocket connection matches protocol of site js loaded on. if page https://, it'll try make wss:// connection, , http://, ws:// connection. sure nginx configured proxy appropriate 1 (or both).
i believe you'll need proxy websocket requests same port you're proxying livereload.js file to.
Comments
Post a Comment