From 998bc7cba0ea9ce8af65b39bc2dce7e608e90f6e Mon Sep 17 00:00:00 2001 From: Imuli Date: Sun, 12 Jun 2016 10:35:23 -0400 Subject: [PATCH] add a host option to listen on a specific ip --- app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index d00e6a4..a6e28d1 100644 --- a/app.js +++ b/app.js @@ -32,6 +32,10 @@ var opts = require('optimist') demand: false, description: 'defaults to "password", you can use "publickey,password" instead' }, + host: { + demand: false, + description: 'wetty listen host' + }, port: { demand: true, alias: 'p', @@ -81,11 +85,11 @@ app.get('/wetty/ssh/:user', function(req, res) { app.use('/', express.static(path.join(__dirname, 'public'))); if (runhttps) { - httpserv = https.createServer(opts.ssl, app).listen(opts.port, function() { + httpserv = https.createServer(opts.ssl, app).listen(opts.port, opts.host, function() { console.log('https on port ' + opts.port); }); } else { - httpserv = http.createServer(app).listen(opts.port, function() { + httpserv = http.createServer(app).listen(opts.port, opts.host, function() { console.log('http on port ' + opts.port); }); }