@sodacore/ws
Version:
Sodacore ws is a core plugin that extends the Http plugin offering WebSocket support to the Sodacore framework.
17 lines • 633 B
TypeScript
import type { IServerWsContext } from '../types';
import type { ServerWebSocket } from 'bun';
import { HttpContext } from '@sodacore/http';
export default class WsContext extends HttpContext {
private socket;
private logger;
private data;
constructor(socket: ServerWebSocket<IServerWsContext>);
setData(data: Record<string, any>): void;
getId(): string;
getRemoteAddress(): string;
send(command: string, context?: Record<string, any>): void;
sendRaw(data: string): void;
getData<T = Record<string, any>>(): T;
close(reason?: string, code?: number): void;
}
//# sourceMappingURL=ws.d.ts.map