|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
const https = require("https");
|
|
|
|
|
const http = require("http");
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
const ini = require("ini");
|
|
|
|
|
const lineReader = require('line-reader');
|
|
|
|
@ -32,12 +32,8 @@ updatelinks();
|
|
|
|
|
|
|
|
|
|
let serverPort = inifile.config.port;
|
|
|
|
|
|
|
|
|
|
const server = https
|
|
|
|
|
const server = http
|
|
|
|
|
.createServer(
|
|
|
|
|
{
|
|
|
|
|
key: fs.readFileSync("key.pem"),
|
|
|
|
|
cert: fs.readFileSync("cert.pem"),
|
|
|
|
|
},
|
|
|
|
|
app
|
|
|
|
|
)
|
|
|
|
|
.listen(serverPort, ()=>{
|
|
|
|
@ -83,7 +79,7 @@ function updatelinks() {
|
|
|
|
|
};
|
|
|
|
|
let i = 0;
|
|
|
|
|
while (i < lines.length) {
|
|
|
|
|
if(lines[i] != "") {
|
|
|
|
|
if(lines[i] != "" && lines[i].match(linksregex)) {
|
|
|
|
|
var mylinks = lines[i].match(linksregex);
|
|
|
|
|
// console.log(JSON.stringify(lines[i]));
|
|
|
|
|
var linkrec = {'timestamp':mylinks[1].substr(0,19)+'Z' , 'protocol':mylinks[2] , 'device':mylinks[4],
|
|
|
|
|