secure-channel — API
ChannelMessageType
Заголовок раздела «ChannelMessageType»export type ChannelMessageType = | 'request' | 'response' | 'event' | 'command' | 'command-result'ChannelMessage
Заголовок раздела «ChannelMessage»export interface ChannelMessage { type: ChannelMessageType id?: string route?: string expectReply?: boolean statusCode?: number headers?: Record<string, string> payload?: any error?: string}SecureChannelClientOptions
Заголовок раздела «SecureChannelClientOptions»export interface SecureChannelClientOptions { url: string serviceId: string certificate: string // PEM privateKey: string // PEM caCertificate?: string // PEM reconnectDelayMs?: number requestTimeoutMs?: number maxSkewMs?: number nonceTtlMs?: number nonceCacheSize?: number}RequestOptions
Заголовок раздела «RequestOptions»export interface RequestOptions { route: string payload?: any expectReply?: boolean headers?: Record<string, string> timeoutMs?: number}SecureChannelServerOptions
Заголовок раздела «SecureChannelServerOptions»export interface SecureChannelServerOptions { wss: WebSocketServer verifyClient?: (peerCert: any) => boolean onRequest: (route: string, payload: any, raw: ChannelMessage, ws?: any) => Promise<any> maxSkewMs?: number nonceTtlMs?: number nonceCacheSize?: number}bindSecureChannelServer
Заголовок раздела «bindSecureChannelServer»export function bindSecureChannelServer(options: SecureChannelServerOptions): void