Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If 'localhost' is provided, don't use '0.0.0.0' for livereload #50

Closed
StephanBijzitter opened this issue Feb 18, 2016 · 4 comments
Closed

Comments

@StephanBijzitter
Copy link

See: gruntjs/grunt-contrib-watch#493

grunt-contrib-connect options:

port: 8080,
livereload: 35729

grunt-contrib-watch livereload options:

host: 'localhost',
port: 35729

I use Vagrant with VirtualBox and a Ubuntu LTS release.

My page loads correctly at localhost:8080/index.html, and contains a script tag (automatically inserted by livereload) that points to 0.0.0.0:35729/livereload.js?snipver=1. The grunt commands are all executed inside the virtual machine.

Now on OS X, this works correctly. My browser is able to resolve both URLs and livereload functions as it should.

However, this is not the case on Windows! Windows is unable to resolve 0.0.0.0:35729, and so livereload is not usable. Changing the URL in the script tag manually to localhost:35729/livereload.js?snipver=1 does allow Windows to work.

Alas, this would be my request:
If localhost is explicitly defined as the host, then force the usage of localhost instead of 0.0.0.0.

@smhg
Copy link
Contributor

smhg commented Jan 14, 2018

This seems to be a job for the livereload server that you are using?
Or in this case, connect-livereload which is used by grunt-contrib-connect and inserts the script tag.
Or do I get it wrong?

@smhg
Copy link
Contributor

smhg commented Jan 14, 2018

I'll close this for now, but please let me know if I got it wrong.

@smhg smhg closed this as completed Jan 14, 2018
@MGRProgramming
Copy link

Not working for me (Windows 7, Chrome 65)
Did I make the changes at the right position or do I have to start with an option?

I changed line 27 of index.js at connect-livereload to
'<script src="localhost:35729/livereload.js?snipver=1" async="" defer=""></script>'
but after starting with "npm start" dev tools at browser still say:
localhost:35729/livereload.js?snipver=1 net::ERR_UNKNOWN_URL_SCHEME

@smhg
Copy link
Contributor

smhg commented Feb 28, 2018

@MGRProgramming please file an issue with the project you are using (connect-livereload) and don't hijack closed issues here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants