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.

83 lines (82 loc) 2.01 kB
/** * Shared types for certificate management and domain options */ /** * Domain forwarding configuration */ export interface IForwardConfig { ip: string; port: number; } /** * Domain configuration options */ export interface IDomainOptions { domainName: string; sslRedirect: boolean; acmeMaintenance: boolean; forward?: IForwardConfig; acmeForward?: IForwardConfig; } /** * Certificate data that can be emitted via events or set from outside */ export interface ICertificateData { domain: string; certificate: string; privateKey: string; expiryDate: Date; } /** * Events emitted by the Port80Handler */ export declare enum Port80HandlerEvents { CERTIFICATE_ISSUED = "certificate-issued", CERTIFICATE_RENEWED = "certificate-renewed", CERTIFICATE_FAILED = "certificate-failed", CERTIFICATE_EXPIRING = "certificate-expiring", MANAGER_STARTED = "manager-started", MANAGER_STOPPED = "manager-stopped", REQUEST_FORWARDED = "request-forwarded" } /** * Certificate failure payload type */ export interface ICertificateFailure { domain: string; error: string; isRenewal: boolean; } /** * Certificate expiry payload type */ export interface ICertificateExpiring { domain: string; expiryDate: Date; daysRemaining: number; } /** * Forwarding configuration for specific domains in ACME setup */ export interface IDomainForwardConfig { domain: string; forwardConfig?: IForwardConfig; acmeForwardConfig?: IForwardConfig; sslRedirect?: boolean; } /** * Unified ACME configuration options used across proxies and handlers */ export interface IAcmeOptions { accountEmail?: string; enabled?: boolean; port?: number; useProduction?: boolean; httpsRedirectPort?: number; renewThresholdDays?: number; renewCheckIntervalHours?: number; autoRenew?: boolean; certificateStore?: string; skipConfiguredCerts?: boolean; domainForwards?: IDomainForwardConfig[]; }