@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.
50 lines (49 loc) • 1.9 kB
TypeScript
export { TlsRecordType, TlsHandshakeType, TlsExtensionType, TlsAlertLevel, TlsAlertDescription, TlsVersion } from '../../protocols/tls/index.js';
/**
* Utility functions for TLS protocol operations
*/
export declare class TlsUtils {
/**
* Checks if a buffer contains a TLS handshake record
* @param buffer The buffer to check
* @returns true if the buffer starts with a TLS handshake record
*/
static isTlsHandshake(buffer: Buffer): boolean;
/**
* Checks if a buffer contains TLS application data
* @param buffer The buffer to check
* @returns true if the buffer starts with a TLS application data record
*/
static isTlsApplicationData(buffer: Buffer): boolean;
/**
* Checks if a buffer contains a TLS alert record
* @param buffer The buffer to check
* @returns true if the buffer starts with a TLS alert record
*/
static isTlsAlert(buffer: Buffer): boolean;
/**
* Checks if a buffer contains a TLS ClientHello message
* @param buffer The buffer to check
* @returns true if the buffer appears to be a ClientHello message
*/
static isClientHello(buffer: Buffer): boolean;
/**
* Gets the record length from a TLS record header
* @param buffer Buffer containing a TLS record
* @returns The record length if the buffer is valid, -1 otherwise
*/
static getTlsRecordLength(buffer: Buffer): number;
/**
* Creates a connection ID based on source/destination information
* Used to track fragmented ClientHello messages across multiple packets
*
* @param connectionInfo Object containing connection identifiers
* @returns A string ID for the connection
*/
static createConnectionId(connectionInfo: {
sourceIp?: string;
sourcePort?: number;
destIp?: string;
destPort?: number;
}): string;
}