V0.1.1 Added env var and enabled websocket

This commit is contained in:
Christian Risi 2025-06-05 11:09:26 +02:00
parent b02370a69a
commit 8a75d7c0e7
2 changed files with 12 additions and 19 deletions

View File

@ -2,7 +2,11 @@ import { SuricataSocketStream } from "./socket-server/server.ts";
// UGLY: take them from
const UNIXPATH = "/var/lib/suricata/eve.sock"
const WEB_SOCKET_URI = ""
const WEB_SOCKET_URI = Deno.env.get("WEBSOCKET_RELAY")
if (!WEB_SOCKET_URI) {
throw Error("There's no value associated with WEBSOCKET_RELAY environment variable")
}
const app = new SuricataSocketStream(
UNIXPATH,

View File

@ -59,17 +59,6 @@ export class SuricataSocketStream {
// UGLY: change this to a more flexible method
private messageProcess(msg: string | Uint8Array) {
// this.webSocket.send(msg);
console.log(
`
Debug, found this message:
${msg}
END OF MESSAGE
`
)
this.webSocket.send(msg);
}
}