start working on websocket stuff

This commit is contained in:
Lee
2024-01-01 17:19:11 +00:00
parent 9fc087beeb
commit 15c0d2403f
5 changed files with 197 additions and 14 deletions

View File

@ -0,0 +1,17 @@
import { Server } from "socket.io";
import { logger } from "../utils/logger";
export default class WebsocketServer {
private server: Server;
constructor(port: number) {
logger.info(`Starting websocket server on port ${port}`);
this.server = new Server(port);
this.server.on("connection", (socket) => {
logger.info("ws: Client connected");
// todo: send ping data to client
});
}
}