1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-21 02:01:33 +02:00

🐛 fix bundle gateway listen

This commit is contained in:
Flam3rboy 2021-08-13 20:54:03 +02:00
parent 49da976943
commit 88853f57df

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);