Merge pull request #68 from JonathanHuot/master
Added listen IP parameter
This commit is contained in:
commit
b50deee77e
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"debug": false,
|
||||
"host": "0.0.0.0",
|
||||
"port": 9000,
|
||||
"theme": "themes/example.css",
|
||||
"public": true
|
||||
|
|
|
@ -4,6 +4,7 @@ var program = require("commander");
|
|||
var shout = require("../server");
|
||||
|
||||
program
|
||||
.option("-h, --host <ip>")
|
||||
.option("-p, --port <port>")
|
||||
.command("start")
|
||||
.description("Start the server")
|
||||
|
@ -15,7 +16,8 @@ program
|
|||
console.log("Create a new user with 'shout add <name>'.")
|
||||
console.log("");
|
||||
} else {
|
||||
var host = program.host || config.host;
|
||||
var port = program.port || config.port;
|
||||
shout(port, config.public);
|
||||
shout(port, host, config.public);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -26,15 +26,16 @@ var inputs = [
|
|||
"whois"
|
||||
];
|
||||
|
||||
module.exports = function(port, isPublic) {
|
||||
module.exports = function(port, host, isPublic) {
|
||||
config.port = port;
|
||||
config.host = host;
|
||||
config.public = isPublic;
|
||||
|
||||
var app = http()
|
||||
.use(index)
|
||||
.use(http.static("client"))
|
||||
.use(http.static(process.env.HOME + "/.shout/cache"))
|
||||
.listen(config.port);
|
||||
.listen(config.port, config.host);
|
||||
|
||||
sockets = io(app);
|
||||
sockets.on("connect", function(socket) {
|
||||
|
@ -46,7 +47,7 @@ module.exports = function(port, isPublic) {
|
|||
});
|
||||
|
||||
console.log("");
|
||||
console.log("Shout is now running on port " + config.port);
|
||||
console.log("Shout is now running on host/port " + config.host + ":" + config.port);
|
||||
console.log("Press ctrl-c to stop");
|
||||
console.log("");
|
||||
|
||||
|
|
Loading…
Reference in New Issue