mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-04 19:18:32 +00:00
Bind to 127.0.0.1 on Windows only
This commit is contained in:
parent
3df272fb92
commit
15cf76c767
@ -19,7 +19,7 @@ npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
Then open http://127.0.0.1:3000 in a web browser.
|
||||
Then open http://0.0.0.0:3000 in a web browser (use http://127.0.0.1:3000 is running under Windows).
|
||||
|
||||
## Addons
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
var expressWs = require('express-ws')(app);
|
||||
var os = require('os');
|
||||
var pty = require('pty.js');
|
||||
|
||||
app.use('/src', express.static(__dirname + '/../src'));
|
||||
@ -46,7 +47,7 @@ app.ws('/bash', function(ws, req) {
|
||||
});
|
||||
|
||||
var port = process.env.PORT || 3000,
|
||||
host = '127.0.0.1';
|
||||
host = os.platform() === 'win32' ? '127.0.0.1' : '0.0.0.0';
|
||||
|
||||
console.log('App listening to http://' + host + ':' + port);
|
||||
app.listen(port, host);
|
||||
|
Loading…
Reference in New Issue
Block a user