fix some bun related issues

This commit is contained in:
Soph :3 2024-04-28 18:36:36 +03:00
parent 7159558e5e
commit 2c6835e2b3
Signed by: sophie
GPG key ID: EDA5D222A0C270F2
2 changed files with 14 additions and 10 deletions

View file

@ -36,7 +36,7 @@ export class Server {
async start(port: number) {
this.server = Bun.listen<{dataBuffer?: Buffer}>({
hostname: "localhost",
hostname: process.env.HOST!,
port: +process.env.PORT!,
socket: {
data: (socket, data) => {
@ -67,7 +67,9 @@ export class Server {
open: (socket) => {
socket.data = {}
},
close(socket) {},
close: async (socket) => {
await this.removeUser(socket, "Disconnected");
},
drain(socket) {},
error(socket, error) {},
},