gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

Livereload blockd, fail to connect http://0.0.0.0:35729/livereload.js?snipver=1 #200

Closed dongguader closed 8 years ago

dongguader commented 8 years ago

is there a way to configure where the hostname of livereload?

In my use case, connection to http://0.0.0.0:35729/livereload.js?snipver=1 is blocked due to security policy.

I had to downgrade to 0.8.0, which injects the following, and accessing livereload through localhost.

rienheuver commented 8 years ago

I got the same problem just today and after quite some searching I found that setting the following option works: hostname: 'localhost'

jacksodj commented 8 years ago

Where are you setting that? I am not getting any luck having that change the 35729 call

rienheuver commented 8 years ago

This is what my connect-task in my Gruntfile looks like: connect: { server: { options: { livereload: true, open: true, hostname: 'localhost' } } }

dongguader commented 8 years ago

Hi,

Thanks, the issue is resolved. Somehow on windows, I have to clean browser cache every time to allow the change from 0.0.0.0 to localhost to take effect. Setting it as localhost does work, just need to remember to clean browser cache.

8bitsquid commented 8 years ago

I ran into this same issue. Ctrl + F5 to refresh and override the browser cache worked for me in Chrome after changing the hostname (haven't confirmed in Firefox, but it should work).