fix(core): refactor: Rename IPortProxySettings to ISmartProxyOptions in internal modules
This commit is contained in:
parent
12b18373db
commit
c6dff8b78d
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-05-04 - 10.0.7 - fix(core)
|
||||||
|
refactor: Rename IPortProxySettings to ISmartProxyOptions in internal modules
|
||||||
|
|
||||||
|
- Replaced IPortProxySettings with ISmartProxyOptions in connection handler, connection manager, domain config manager, security manager, timeout manager, TLS manager, and network proxy bridge.
|
||||||
|
- Updated type imports and constructors accordingly while preserving backward compatibility via export alias.
|
||||||
|
|
||||||
## 2025-05-04 - 10.0.6 - fix(smartproxy)
|
## 2025-05-04 - 10.0.6 - fix(smartproxy)
|
||||||
No changes detected in project files. This commit updates commit info without modifying any functionality.
|
No changes detected in project files. This commit updates commit info without modifying any functionality.
|
||||||
|
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartproxy',
|
name: '@push.rocks/smartproxy',
|
||||||
version: '10.0.6',
|
version: '10.0.7',
|
||||||
description: '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.'
|
description: '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.'
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import * as plugins from '../plugins.js';
|
|||||||
import type {
|
import type {
|
||||||
IConnectionRecord,
|
IConnectionRecord,
|
||||||
IDomainConfig,
|
IDomainConfig,
|
||||||
IPortProxySettings,
|
ISmartProxyOptions,
|
||||||
} from './classes.pp.interfaces.js';
|
} from './classes.pp.interfaces.js';
|
||||||
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
||||||
import { SecurityManager } from './classes.pp.securitymanager.js';
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
||||||
@ -17,7 +17,7 @@ import { PortRangeManager } from './classes.pp.portrangemanager.js';
|
|||||||
*/
|
*/
|
||||||
export class ConnectionHandler {
|
export class ConnectionHandler {
|
||||||
constructor(
|
constructor(
|
||||||
private settings: IPortProxySettings,
|
private settings: ISmartProxyOptions,
|
||||||
private connectionManager: ConnectionManager,
|
private connectionManager: ConnectionManager,
|
||||||
private securityManager: SecurityManager,
|
private securityManager: SecurityManager,
|
||||||
private domainConfigManager: DomainConfigManager,
|
private domainConfigManager: DomainConfigManager,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IConnectionRecord, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
import { SecurityManager } from './classes.pp.securitymanager.js';
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
||||||
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ export class ConnectionManager {
|
|||||||
} = { incoming: {}, outgoing: {} };
|
} = { incoming: {}, outgoing: {} };
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private settings: IPortProxySettings,
|
private settings: ISmartProxyOptions,
|
||||||
private securityManager: SecurityManager,
|
private securityManager: SecurityManager,
|
||||||
private timeoutManager: TimeoutManager
|
private timeoutManager: TimeoutManager
|
||||||
) {}
|
) {}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IDomainConfig, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IDomainConfig, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages domain configurations and target selection
|
* Manages domain configurations and target selection
|
||||||
@ -8,7 +8,7 @@ export class DomainConfigManager {
|
|||||||
// Track round-robin indices for domain configs
|
// Track round-robin indices for domain configs
|
||||||
private domainTargetIndices: Map<IDomainConfig, number> = new Map();
|
private domainTargetIndices: Map<IDomainConfig, number> = new Map();
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the domain configurations
|
* Updates the domain configurations
|
||||||
|
@ -22,7 +22,7 @@ export interface IDomainConfig {
|
|||||||
|
|
||||||
/** Port proxy settings including global allowed port ranges */
|
/** Port proxy settings including global allowed port ranges */
|
||||||
import type { IAcmeOptions } from '../common/types.js';
|
import type { IAcmeOptions } from '../common/types.js';
|
||||||
export interface IPortProxySettings {
|
export interface ISmartProxyOptions {
|
||||||
fromPort: number;
|
fromPort: number;
|
||||||
toPort: number;
|
toPort: number;
|
||||||
targetIP?: string; // Global target host to proxy to, defaults to 'localhost'
|
targetIP?: string; // Global target host to proxy to, defaults to 'localhost'
|
||||||
|
@ -4,7 +4,7 @@ import { Port80Handler } from '../port80handler/classes.port80handler.js';
|
|||||||
import { Port80HandlerEvents } from '../common/types.js';
|
import { Port80HandlerEvents } from '../common/types.js';
|
||||||
import { subscribeToPort80Handler } from '../common/eventUtils.js';
|
import { subscribeToPort80Handler } from '../common/eventUtils.js';
|
||||||
import type { ICertificateData } from '../common/types.js';
|
import type { ICertificateData } from '../common/types.js';
|
||||||
import type { IConnectionRecord, IPortProxySettings, IDomainConfig } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages NetworkProxy integration for TLS termination
|
* Manages NetworkProxy integration for TLS termination
|
||||||
@ -13,7 +13,7 @@ export class NetworkProxyBridge {
|
|||||||
private networkProxy: NetworkProxy | null = null;
|
private networkProxy: NetworkProxy | null = null;
|
||||||
private port80Handler: Port80Handler | null = null;
|
private port80Handler: Port80Handler | null = null;
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the Port80Handler to use for certificate management
|
* Set the Port80Handler to use for certificate management
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import type{ IPortProxySettings } from './classes.pp.interfaces.js';
|
import type{ ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages port ranges and port-based configuration
|
* Manages port ranges and port-based configuration
|
||||||
*/
|
*/
|
||||||
export class PortRangeManager {
|
export class PortRangeManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all ports that should be listened on
|
* Get all ports that should be listened on
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles security aspects like IP tracking, rate limiting, and authorization
|
* Handles security aspects like IP tracking, rate limiting, and authorization
|
||||||
@ -8,7 +8,7 @@ export class SecurityManager {
|
|||||||
private connectionsByIP: Map<string, Set<string>> = new Map();
|
private connectionsByIP: Map<string, Set<string>> = new Map();
|
||||||
private connectionRateByIP: Map<string, number[]> = new Map();
|
private connectionRateByIP: Map<string, number[]> = new Map();
|
||||||
|
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get connections count by IP
|
* Get connections count by IP
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import type { IConnectionRecord, IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages timeouts and inactivity tracking for connections
|
* Manages timeouts and inactivity tracking for connections
|
||||||
*/
|
*/
|
||||||
export class TimeoutManager {
|
export class TimeoutManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure timeout values don't exceed Node.js max safe integer
|
* Ensure timeout values don't exceed Node.js max safe integer
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from '../plugins.js';
|
import * as plugins from '../plugins.js';
|
||||||
import type { IPortProxySettings } from './classes.pp.interfaces.js';
|
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
||||||
import { SniHandler } from './classes.pp.snihandler.js';
|
import { SniHandler } from './classes.pp.snihandler.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +16,7 @@ interface IConnectionInfo {
|
|||||||
* Manages TLS-related operations including SNI extraction and validation
|
* Manages TLS-related operations including SNI extraction and validation
|
||||||
*/
|
*/
|
||||||
export class TlsManager {
|
export class TlsManager {
|
||||||
constructor(private settings: IPortProxySettings) {}
|
constructor(private settings: ISmartProxyOptions) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a data chunk appears to be a TLS handshake
|
* Check if a data chunk appears to be a TLS handshake
|
||||||
|
@ -13,8 +13,8 @@ import { CertProvisioner } from './classes.pp.certprovisioner.js';
|
|||||||
import type { ICertificateData } from '../common/types.js';
|
import type { ICertificateData } from '../common/types.js';
|
||||||
import { buildPort80Handler } from '../common/acmeFactory.js';
|
import { buildPort80Handler } from '../common/acmeFactory.js';
|
||||||
|
|
||||||
import type { IPortProxySettings, IDomainConfig } from './classes.pp.interfaces.js';
|
import type { ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
||||||
export type { IPortProxySettings, IDomainConfig };
|
export type { ISmartProxyOptions as IPortProxySettings, IDomainConfig };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SmartProxy - Main class that coordinates all components
|
* SmartProxy - Main class that coordinates all components
|
||||||
@ -39,7 +39,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|||||||
// CertProvisioner for unified certificate workflows
|
// CertProvisioner for unified certificate workflows
|
||||||
private certProvisioner?: CertProvisioner;
|
private certProvisioner?: CertProvisioner;
|
||||||
|
|
||||||
constructor(settingsArg: IPortProxySettings) {
|
constructor(settingsArg: ISmartProxyOptions) {
|
||||||
super();
|
super();
|
||||||
// Set reasonable defaults for all settings
|
// Set reasonable defaults for all settings
|
||||||
this.settings = {
|
this.settings = {
|
||||||
@ -119,7 +119,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|||||||
/**
|
/**
|
||||||
* The settings for the port proxy
|
* The settings for the port proxy
|
||||||
*/
|
*/
|
||||||
public settings: IPortProxySettings;
|
public settings: ISmartProxyOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the Port80Handler for ACME certificate management
|
* Initialize the Port80Handler for ACME certificate management
|
||||||
|
Loading…
x
Reference in New Issue
Block a user