import { streamSocket } from "../../common/socket.ts"; import { Realm, Session } from "./state.ts"; export async function realmHandler(ws: WebSocket, realm: Realm, auth: Session, signal: AbortSignal) { ws.send(`welcome ${auth.identid} to ${auth.realmid} - ${realm.identities.keys()} `); for await (const message of streamSocket(ws, { signal })) { ws.send(`you said: ${message}`); } }