Make it more clear that the server is listening on INADDR_ANY

This commit is contained in:
Tim Kang 2015-02-20 20:48:30 -08:00
parent 70f142b9a0
commit a8bb230990
2 changed files with 6 additions and 6 deletions

View File

@ -27,7 +27,7 @@ module.exports = function(grunt) {
options = _.defaults(options, defaults); options = _.defaults(options, defaults);
} }
var host = (options.hostname || '') + ':' + options.port; var host = (options.host || '*') + ':' + options.port;
if (servers[host]) { if (servers[host]) {
this.server = servers[host]; this.server = servers[host];
@ -42,7 +42,7 @@ module.exports = function(grunt) {
} }
process.exit(1); process.exit(1);
}); });
this.server.listen(options.port, options.hostname, function (err) { this.server.listen(options.port, options.host, function(err) {
if (err) { return grunt.fatal(err); } if (err) { return grunt.fatal(err); }
grunt.log.verbose.writeln('Live reload server started on ' + host); grunt.log.verbose.writeln('Live reload server started on ' + host);
}); });

View File

@ -56,7 +56,7 @@ exports.livereload = {
result = helper.unixify(result); result = helper.unixify(result);
helper.verboseLog(result); helper.verboseLog(result);
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.'); test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on :35729') !== -1, test.ok(result.indexOf('Live reload server started on *:35729') !== -1,
'live reload server should have been started on port 35729.'); 'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js'); test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js');
resultData = JSON.parse(resultData); resultData = JSON.parse(resultData);
@ -119,7 +119,7 @@ exports.livereload = {
result = helper.unixify(result); result = helper.unixify(result);
helper.verboseLog(result); helper.verboseLog(result);
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.'); test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on :9876') !== -1, test.ok(result.indexOf('Live reload server started on *:9876') !== -1,
'live reload server should have been started on port 9876.'); 'live reload server should have been started on port 9876.');
test.ok(/Live reloading (lib\/one\.js, lib\/two.js|lib\/two.js, lib\/one.js)\.\.\./.test(result), test.ok(/Live reloading (lib\/one\.js, lib\/two.js|lib\/two.js, lib\/one.js)\.\.\./.test(result),
'live reload should have triggered on lib/one.js and lib/two.js'); 'live reload should have triggered on lib/one.js and lib/two.js');
@ -142,7 +142,7 @@ exports.livereload = {
result = helper.unixify(result); result = helper.unixify(result);
helper.verboseLog(result); helper.verboseLog(result);
test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.'); test.ok(result.indexOf('I ran before livereload.') !== -1, 'task should have ran before live reload.');
test.ok(result.indexOf('Live reload server started on :1337') !== -1, test.ok(result.indexOf('Live reload server started on *:1337') !== -1,
'live reload server should have been started on port 1337.'); 'live reload server should have been started on port 1337.');
test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js'); test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js');
resultData = JSON.parse(resultData); resultData = JSON.parse(resultData);
@ -163,7 +163,7 @@ exports.livereload = {
}], function(result) { }], function(result) {
result = helper.unixify(result); result = helper.unixify(result);
helper.verboseLog(result); helper.verboseLog(result);
test.ok(result.indexOf('Live reload server started on :35729') !== -1, test.ok(result.indexOf('Live reload server started on *:35729') !== -1,
'live reload server should have been started on port 35729.'); 'live reload server should have been started on port 35729.');
test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js'); test.ok(result.indexOf('Live reloading lib/one.js...') !== -1, 'live reload should have triggered on lib/one.js');
resultData = JSON.parse(resultData); resultData = JSON.parse(resultData);