V0.1.1 Added env var and enabled websocket
This commit is contained in:
parent
b02370a69a
commit
8a75d7c0e7
@ -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,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user