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.

96 lines (95 loc) 2.9 kB
import * as plugins from '../../plugins.js'; import { type IHttpProxyOptions } from './models/types.js'; import type { IRouteConfig } from '../smart-proxy/models/route-types.js'; /** * @deprecated This class is deprecated. Use SmartCertManager instead. * * This is a stub implementation that maintains backward compatibility * while the functionality has been moved to SmartCertManager. */ export declare class CertificateManager { private options; private defaultCertificates; private certificateCache; private certificateStoreDir; private logger; private httpsServer; private initialized; constructor(options: IHttpProxyOptions); /** * Synchronous initialization for backward compatibility * @deprecated This uses sync filesystem operations which block the event loop */ private initializeSync; /** * Async initialization - preferred method */ initialize(): Promise<void>; /** * Loads default certificates from the filesystem * @deprecated This uses sync filesystem operations which block the event loop */ loadDefaultCertificates(): void; /** * Loads default certificates from the filesystem asynchronously */ loadDefaultCertificatesAsync(): Promise<void>; /** * Generates self-signed certificates as fallback */ private generateSelfSignedCertificate; /** * Gets the default certificates */ getDefaultCertificates(): { key: string; cert: string; }; /** * @deprecated Use SmartCertManager instead */ setExternalPort80Handler(handler: any): void; /** * @deprecated Use SmartCertManager instead */ updateRoutes(routes: IRouteConfig[]): Promise<void>; /** * Handles SNI callback to provide appropriate certificate */ handleSNI(domain: string, cb: (err: Error | null, ctx: plugins.tls.SecureContext) => void): void; /** * Updates a certificate in the cache */ updateCertificate(domain: string, cert: string, key: string): void; /** * Gets a cached certificate */ private getCachedCertificate; /** * @deprecated Use SmartCertManager instead */ initializePort80Handler(): Promise<any>; /** * @deprecated Use SmartCertManager instead */ stopPort80Handler(): Promise<void>; /** * @deprecated Use SmartCertManager instead */ registerDomainsWithPort80Handler(domains: string[]): void; /** * @deprecated Use SmartCertManager instead */ registerRoutesWithPort80Handler(routes: IRouteConfig[]): void; /** * Sets the HTTPS server for certificate updates */ setHttpsServer(server: plugins.https.Server): void; /** * Gets statistics for metrics */ getStats(): { cachedCertificates: number; defaultCertEnabled: boolean; }; }