1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

🐛 fix bundle gateway listen

This commit is contained in:
Flam3rboy 2021-08-13 20:54:03 +02:00
parent 213b5811c4
commit a772b32f6b

View File

@ -22,9 +22,15 @@ export class Server {
res.writeHead(200).end("Online");
});
this.server.on("upgrade", (request, socket, head) => {
this.ws.handleUpgrade(request, socket, head, (socket) => {
this.ws.emit("connection", socket, request);
});
});
this.ws = new WebSocketServer({
maxPayload: 4096,
server: this.server,
noServer: true,
});
this.ws.on("connection", Connection);
this.ws.on("error", console.error);