/// import ObfsMethod from './obfs' import Connection from '../helper/connection' /** * The WebSocket class is an obfuscation method based on the * WebSocket protocol. */ declare class WebSocket extends ObfsMethod { path: string name: string encryption: string compression: string handshakeFlag: boolean hostName: string | undefined constructor( connection: Connection, path: string | undefined, hostName: string | undefined, compression?: string, encryption?: string ) /** * Checks if the incoming message matches the expected WebSocket format. * @param message - The incoming message. * @returns Whether the message matches the WebSocket format. */ check(message: Buffer): boolean private generateWebSocketKey /** * Initiates the WebSocket handshake for the CLIENT. * For SERVER type, waits for client handshake and responds accordingly. * @param callback - A callback to invoke after the handshake. */ handshake(callback?: () => void): void /** * DeObfuscates a WebSocket message. * @param message - The obfuscated WebSocket message. * @returns The de-obfuscated message payload. */ deObfuscate(message: Buffer): Buffer /** * Obfuscates a message by framing it as a WebSocket message. * @param message - The non-obfuscated message. * @returns The obfuscated WebSocket message. */ obfuscate(message: Buffer): Buffer } /** * Builds a WebSocket obfuscation method object. * @param path - Endpoint path. * @param compression - Compression method. * @param encryption - Encryption algorithm. */ export declare const websocket: ( path?: string, hostName?: string | undefined, compression?: string, encryption?: string ) => (connection: Connection) => WebSocket export {}