UNPKG

@hyperflake/socket-broker

Version:
23 lines (22 loc) 668 B
import { ServerOptions as SocketServerOptions } from 'socket.io'; export interface SocketBrokerOptions extends Partial<SocketServerOptions> { authenticationType?: 'none' | 'keyAndSecret'; auth?: { key: string; secret: string; }; } export declare class SocketBroker { private httpServer; private socketServer; private socketList; private authenticationType; private auth; constructor(options?: SocketBrokerOptions); private init; private authKeyAndSecretAuthentication; private onSocketConnect; private onSocketEvent; private onSocketDisconnect; listen(port: number, cb?: () => void): void; }