mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
📝 improve logging
This commit is contained in:
parent
f2e8e2e031
commit
90c5444324
@ -32,7 +32,6 @@ export class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.server.on("upgrade", (request, socket, head) => {
|
this.server.on("upgrade", (request, socket, head) => {
|
||||||
console.log("socket requests upgrade", request.url);
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.ws.handleUpgrade(request, socket, head, (socket) => {
|
this.ws.handleUpgrade(request, socket, head, (socket) => {
|
||||||
this.ws.emit("connection", socket, request);
|
this.ws.emit("connection", socket, request);
|
||||||
|
@ -28,6 +28,7 @@ export async function Connection(
|
|||||||
socket.on("close", Close);
|
socket.on("close", Close);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
socket.on("message", Message);
|
socket.on("message", Message);
|
||||||
|
console.log(`[Gateway] Connections: ${this.clients.size}`);
|
||||||
|
|
||||||
const { searchParams } = new URL(`http://localhost${request.url}`);
|
const { searchParams } = new URL(`http://localhost${request.url}`);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -37,8 +37,6 @@ export async function Message(this: WebSocket, buffer: WS.Data) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[Gateway] Opcode " + OPCODES[data.op]);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await OPCodeHandler.call(this, data);
|
return await OPCodeHandler.call(this, data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -214,8 +214,6 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
// application // TODO for applications
|
// application // TODO for applications
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("Send ready");
|
|
||||||
|
|
||||||
// TODO: send real proper data structure
|
// TODO: send real proper data structure
|
||||||
await Send(this, {
|
await Send(this, {
|
||||||
op: OPCODES.Dispatch,
|
op: OPCODES.Dispatch,
|
||||||
|
Loading…
Reference in New Issue
Block a user