start working on websocket stuff
This commit is contained in:
17
src/websocket/websocket.ts
Normal file
17
src/websocket/websocket.ts
Normal 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
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user