Closed timkendrick closed 9 years ago
The Travis build was failing in Node 0.12 due to the port scanning. I'll submit a pull request to fix that first.
The point of using 0.0.0.0 was to make sure the server is available on the local network. If you have time could you please test that your patch makes that possible? Also thanks for taking the time to fix the port scanning!
I'm not sure how I'd be able to test that – my patch only changes the URL that is launched by the open
module, it's not used by connect
at all. Any existing tests for local network availability should be unaffected.
The build is failing at the moment, but I can re-push once pull request #171 has been accepted.
I'm not sure how I'd be able to test that
@timkendrick just test locally if you can.
I'll also check it in a bit...
Yep, just tested from other computers on my local network and everything works as it should (i.e. they can connect to my computer when I specify hostname: "*"
, but they can't connect when I specify hostname: "localhost"
).
@timkendrick we might need to update the doc here: https://github.com/gruntjs/grunt-contrib-connect/blob/master/docs/connect-options.md#hostname
(README docs are generated from /docs
when you run grunt
)
FYI: the lines I changed are only called after the server has been started successfully.
This means that my changes only affect two things:
open()
callAll of the server-initializing functionality should be completely unaffected.
Yeah, I'm not sure whether the documentation for hostname
is misleading or not. My (probably fairly shaky) understanding of that setting is that it's currently used for a combination of two separate things:
open: true
is specified...to my mind, a value of "*"
or "0.0.0.0"
sounds like a perfectly valid default for the hostname
setting if that's what you're asking.
Should I add a note to the documentation saying that if open: true
is specified, the URL that is launched is autogenerated based on on the hostname, defaulting to localhost
for wildcard URLs?
I used yoman generator for angularjs, when I change the host to 0.0.0.0
it opens that instead of localhost or the custom ip...
http://0.0.0.0/ is not a routable address, according to https://code.google.com/p/chromium/issues/detail?id=428046.
This was causing problems when using the combination of '{ hostname: "*", open: true }' with newer versions of Chrome.