UNPKG

@push.rocks/smartproxy

Version:

A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.

57 lines (56 loc) 1.63 kB
import type { IPortProxySettings } from './classes.pp.interfaces.js'; /** * Manages port ranges and port-based configuration */ export declare class PortRangeManager { private settings; constructor(settings: IPortProxySettings); /** * Get all ports that should be listened on */ getListeningPorts(): Set<number>; /** * Check if a port should use NetworkProxy for forwarding */ shouldUseNetworkProxy(port: number): boolean; /** * Check if port should use global forwarding */ shouldUseGlobalForwarding(port: number): boolean; /** * Check if a port is in global ranges */ isPortInGlobalRanges(port: number): boolean; /** * Check if a port falls within the specified ranges */ isPortInRanges(port: number, ranges: Array<{ from: number; to: number; }>): boolean; /** * Get forwarding port for a specific listening port * This determines what port to connect to on the target */ getForwardingPort(listeningPort: number): number; /** * Find domain-specific port ranges that include a given port */ findDomainPortRange(port: number): { domainIndex: number; range: { from: number; to: number; }; } | undefined; /** * Get a list of all configured ports * This includes the fromPort, NetworkProxy ports, and ports from all ranges */ getAllConfiguredPorts(): number[]; /** * Validate port configuration * Returns array of warning messages */ validateConfiguration(): string[]; }