Browse Source

set host/port

master
Martin Dørum 2 years ago
parent
commit
0736057b4c
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      server.js

+ 5
- 1
server.js View File

@@ -5,6 +5,9 @@ let urllib = require("url");
let ws = require("ws");
let mime = require('mime-types')

let port = process.env.PORT || 8080;
let host = process.env.HOSTNAME || "127.0.0.1";

let sessions = {};

class Session {
@@ -128,7 +131,8 @@ let server = http.createServer((req, res) => {
res.end("Redirecting...");
}
});
server.listen(8080);
server.listen(port, host);
console.log(`Listening to ${host}:${port}`);

let wss = new ws.Server({ server });


Loading…
Cancel
Save