remove https and fix crash when other hotspots connect to us
This commit is contained in:
parent
dc9a97383a
commit
005f7c32af
1 changed files with 3 additions and 7 deletions
10
index.js
10
index.js
|
@ -1,4 +1,4 @@
|
||||||
const https = require("https");
|
const http = require("http");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ini = require("ini");
|
const ini = require("ini");
|
||||||
const lineReader = require('line-reader');
|
const lineReader = require('line-reader');
|
||||||
|
@ -32,12 +32,8 @@ updatelinks();
|
||||||
|
|
||||||
let serverPort = inifile.config.port;
|
let serverPort = inifile.config.port;
|
||||||
|
|
||||||
const server = https
|
const server = http
|
||||||
.createServer(
|
.createServer(
|
||||||
{
|
|
||||||
key: fs.readFileSync("key.pem"),
|
|
||||||
cert: fs.readFileSync("cert.pem"),
|
|
||||||
},
|
|
||||||
app
|
app
|
||||||
)
|
)
|
||||||
.listen(serverPort, ()=>{
|
.listen(serverPort, ()=>{
|
||||||
|
@ -83,7 +79,7 @@ function updatelinks() {
|
||||||
};
|
};
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (i < lines.length) {
|
while (i < lines.length) {
|
||||||
if(lines[i] != "") {
|
if(lines[i] != "" && lines[i].match(linksregex)) {
|
||||||
var mylinks = lines[i].match(linksregex);
|
var mylinks = lines[i].match(linksregex);
|
||||||
// console.log(JSON.stringify(lines[i]));
|
// console.log(JSON.stringify(lines[i]));
|
||||||
var linkrec = {'timestamp':mylinks[1].substr(0,19)+'Z' , 'protocol':mylinks[2] , 'device':mylinks[4],
|
var linkrec = {'timestamp':mylinks[1].substr(0,19)+'Z' , 'protocol':mylinks[2] , 'device':mylinks[4],
|
||||||
|
|
Loading…
Add table
Reference in a new issue