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.

42 lines (41 loc) 2.04 kB
import * as plugins from '../../plugins.js'; import type { IRustCertificateStatus, IRustChallengeOptions, IRustMetricsSnapshot, IRustProxyOptions, IRustRouteConfig, IRustStatistics } from './models/rust-types.js'; import type { IActiveConnectionSnapshot, IActiveConnectionSnapshotOptions, ISmartProxySecurityPolicy } from './models/interfaces.js'; /** * Bridge between TypeScript SmartProxy and the Rust binary. * Wraps @push.rocks/smartrust's RustBridge with type-safe command definitions. */ export declare class RustProxyBridge extends plugins.EventEmitter { private bridge; constructor(); /** * Spawn the Rust binary in management mode. * Returns true if the binary was found and spawned successfully. */ spawn(): Promise<boolean>; /** * Kill the Rust process and clean up. */ kill(): void; /** * Whether the bridge is currently running. */ get running(): boolean; startProxy(config: IRustProxyOptions): Promise<void>; stopProxy(): Promise<void>; updateRoutes(routes: IRustRouteConfig[]): Promise<void>; setSecurityPolicy(policy: ISmartProxySecurityPolicy): Promise<void>; getMetrics(): Promise<IRustMetricsSnapshot>; getStatistics(): Promise<IRustStatistics>; getActiveConnectionSnapshots(options?: IActiveConnectionSnapshotOptions): Promise<IActiveConnectionSnapshot[]>; provisionCertificate(routeName: string): Promise<void>; renewCertificate(routeName: string): Promise<void>; getCertificateStatus(routeName: string): Promise<IRustCertificateStatus | null>; getListeningPorts(): Promise<number[]>; setSocketHandlerRelay(socketPath: string): Promise<void>; setChallengeProviderRelay(socketPath: string, options?: IRustChallengeOptions): Promise<void>; addListeningPort(port: number): Promise<void>; removeListeningPort(port: number): Promise<void>; loadCertificate(domain: string, cert: string, key: string, ca?: string): Promise<void>; setDatagramHandlerRelay(socketPath: string): Promise<void>; }