UNPKG

@push.rocks/smartproxy

Version:

A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.

26 lines (25 loc) 783 B
/** * WebSocket Protocol Utilities */ import type { RawData } from './types.js'; /** * Get the length of a WebSocket message regardless of its type * (handles all possible WebSocket message data types) */ export declare function getMessageSize(data: RawData): number; /** * Convert any raw WebSocket data to Buffer for consistent handling */ export declare function toBuffer(data: RawData): Buffer; /** * Generate WebSocket accept key from client key */ export declare function generateAcceptKey(clientKey: string): string; /** * Validate WebSocket upgrade request */ export declare function isWebSocketUpgrade(headers: Record<string, string>): boolean; /** * Generate random WebSocket key for client handshake */ export declare function generateWebSocketKey(): string;