@push.rocks/smartproxy
Version:
A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.
58 lines (57 loc) • 1.88 kB
TypeScript
import type { IPortProxySettings } from './classes.pp.interfaces.js';
/**
* Interface for connection information used for SNI extraction
*/
interface IConnectionInfo {
sourceIp: string;
sourcePort: number;
destIp: string;
destPort: number;
}
/**
* Manages TLS-related operations including SNI extraction and validation
*/
export declare class TlsManager {
private settings;
constructor(settings: IPortProxySettings);
/**
* Check if a data chunk appears to be a TLS handshake
*/
isTlsHandshake(chunk: Buffer): boolean;
/**
* Check if a data chunk appears to be a TLS ClientHello
*/
isClientHello(chunk: Buffer): boolean;
/**
* Extract Server Name Indication (SNI) from TLS handshake
*/
extractSNI(chunk: Buffer, connInfo: IConnectionInfo, previousDomain?: string): string | undefined;
/**
* Handle session resumption attempts
*/
handleSessionResumption(chunk: Buffer, connectionId: string, hasSNI: boolean): {
shouldBlock: boolean;
reason?: string;
};
/**
* Check for SNI mismatch during renegotiation
*/
checkRenegotiationSNI(chunk: Buffer, connInfo: IConnectionInfo, expectedDomain: string, connectionId: string): {
hasMismatch: boolean;
extractedSNI?: string;
};
/**
* Create a renegotiation handler function for a connection
*/
createRenegotiationHandler(connectionId: string, lockedDomain: string, connInfo: IConnectionInfo, onMismatch: (connectionId: string, reason: string) => void): (chunk: Buffer) => void;
/**
* Analyze TLS connection for browser fingerprinting
* This helps identify browser vs non-browser connections
*/
analyzeClientHello(chunk: Buffer): {
isBrowserConnection: boolean;
isRenewal: boolean;
hasSNI: boolean;
};
}
export {};