Browse Source

add a host option to listen on a specific ip

pull/65/head
Imuli 9 years ago
parent
commit
998bc7cba0
  1. 8
      app.js

8
app.js

@ -32,6 +32,10 @@ var opts = require('optimist')
demand: false, demand: false,
description: 'defaults to "password", you can use "publickey,password" instead' description: 'defaults to "password", you can use "publickey,password" instead'
}, },
host: {
demand: false,
description: 'wetty listen host'
},
port: { port: {
demand: true, demand: true,
alias: 'p', alias: 'p',
@ -81,11 +85,11 @@ app.get('/wetty/ssh/:user', function(req, res) {
app.use('/', express.static(path.join(__dirname, 'public'))); app.use('/', express.static(path.join(__dirname, 'public')));
if (runhttps) { 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); console.log('https on port ' + opts.port);
}); });
} else { } 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); console.log('http on port ' + opts.port);
}); });
} }

Loading…
Cancel
Save