diff --git a/src/dispatch.ts b/src/dispatch.ts index cd41198..468422e 100644 --- a/src/dispatch.ts +++ b/src/dispatch.ts @@ -8,6 +8,7 @@ import { send } from "./websocket" import { setState } from "./state" export async function dispatchMessage(ws: any, msg: Message) { + console.log("<- receive", msg) switch (msg.type) { case "input": await inputMessage(ws, msg); break diff --git a/src/websocket.ts b/src/websocket.ts index b7867a0..813c3de 100644 --- a/src/websocket.ts +++ b/src/websocket.ts @@ -6,6 +6,7 @@ import type { Message } from "./shared/types" const wsConnections: any[] = [] export function send(ws: any, msg: Message) { + console.log("-> send", msg) ws.send(JSON.stringify(msg)) }