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.

44 lines (43 loc) 1.33 kB
import * as plugins from '../../plugins.js'; import type { IConnectionRecord } from './models/interfaces.js'; import type { SmartProxy } from './smart-proxy.js'; /** * Handles new connection processing and setup logic with support for route-based configuration */ export declare class RouteConnectionHandler { private smartProxy; newConnectionSubject: plugins.smartrx.rxjs.Subject<IConnectionRecord>; constructor(smartProxy: SmartProxy); /** * Create a route context object for port and host mapping functions */ private createRouteContext; /** * Handle a new incoming connection */ handleConnection(socket: plugins.net.Socket): void; /** * Handle initial data from a connection to determine routing */ private handleInitialData; /** * Route the connection based on match criteria */ private routeConnection; /** * Select the appropriate target from the targets array based on sub-matching criteria */ private selectTarget; /** * Handle a forward action for a route */ private handleForwardAction; /** * Handle a socket-handler action for a route */ private handleSocketHandlerAction; /** * Sets up a direct connection to the target */ private setupDirectConnection; }