Commit 90920459 authored by r03ert0's avatar r03ert0

use variable `port` instead of full structure

parent fb35cabd
...@@ -21,7 +21,7 @@ tracer.log(whitelist); ...@@ -21,7 +21,7 @@ tracer.log(whitelist);
tracer.log("Use blacklist:", useBlacklist); tracer.log("Use blacklist:", useBlacklist);
tracer.log(blacklist); tracer.log(blacklist);
var http = require('http'); // var http = require('http');
let server; let server;
const ws_cfg = JSON.parse(fs.readFileSync('ws_cfg.json')); const ws_cfg = JSON.parse(fs.readFileSync('ws_cfg.json'));
const {secure, port} = ws_cfg; const {secure, port} = ws_cfg;
...@@ -37,7 +37,7 @@ if(secure) { ...@@ -37,7 +37,7 @@ if(secure) {
|| req.connection.remoteAddress || req.connection.remoteAddress
|| req.socket.remoteAddress || req.socket.remoteAddress
|| req.connection.socket.remoteAddress; || req.connection.socket.remoteAddress;
}).listen(ws_cfg.port); }).listen(port);
} else { } else {
var http = require('http'); var http = require('http');
server = http.createServer(function(req, res) { server = http.createServer(function(req, res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment