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.41 kB
import * as plugins from '../../plugins.js'; import { HttpProxy } from '../http-proxy/index.js'; import type { IConnectionRecord } from './models/interfaces.js'; import type { IRouteConfig } from './models/route-types.js'; import { WrappedSocket } from '../../core/models/wrapped-socket.js'; import type { SmartProxy } from './smart-proxy.js'; export declare class HttpProxyBridge { private smartProxy; private httpProxy; constructor(smartProxy: SmartProxy); /** * Get the HttpProxy instance */ getHttpProxy(): HttpProxy | null; /** * Initialize HttpProxy instance */ initialize(): Promise<void>; /** * Sync routes to HttpProxy */ syncRoutesToHttpProxy(routes: IRouteConfig[]): Promise<void>; /** * Convert route to HttpProxy configuration */ private routeToHttpProxyConfig; /** * Check if connection should use HttpProxy */ shouldUseHttpProxy(connection: IConnectionRecord, routeMatch: any): boolean; /** * Forward connection to HttpProxy */ forwardToHttpProxy(connectionId: string, socket: plugins.net.Socket | WrappedSocket, record: IConnectionRecord, initialChunk: Buffer, httpProxyPort: number, cleanupCallback: (reason: string) => void): Promise<void>; /** * Start HttpProxy */ start(): Promise<void>; /** * Stop HttpProxy */ stop(): Promise<void>; }