@push.rocks/smartproxy 10.0.6 → 10.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/smartproxy/classes.pp.connectionhandler.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.connectionmanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.domainconfigmanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.interfaces.d.ts +1 -1
- package/dist_ts/smartproxy/classes.pp.networkproxybridge.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.portrangemanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.securitymanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.timeoutmanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.pp.tlsmanager.d.ts +2 -2
- package/dist_ts/smartproxy/classes.smartproxy.d.ts +4 -4
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/smartproxy/classes.pp.connectionhandler.ts +2 -2
- package/ts/smartproxy/classes.pp.connectionmanager.ts +2 -2
- package/ts/smartproxy/classes.pp.domainconfigmanager.ts +2 -2
- package/ts/smartproxy/classes.pp.interfaces.ts +1 -1
- package/ts/smartproxy/classes.pp.networkproxybridge.ts +2 -2
- package/ts/smartproxy/classes.pp.portrangemanager.ts +2 -2
- package/ts/smartproxy/classes.pp.securitymanager.ts +2 -2
- package/ts/smartproxy/classes.pp.timeoutmanager.ts +2 -2
- package/ts/smartproxy/classes.pp.tlsmanager.ts +2 -2
- package/ts/smartproxy/classes.smartproxy.ts +4 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '10.0.
|
|
6
|
+
version: '10.0.7',
|
|
7
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.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLG1PQUFtTztDQUNqUCxDQUFBIn0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
|
4
4
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
|
5
5
|
import { DomainConfigManager } from './classes.pp.domainconfigmanager.js';
|
|
@@ -19,7 +19,7 @@ export declare class ConnectionHandler {
|
|
|
19
19
|
private networkProxyBridge;
|
|
20
20
|
private timeoutManager;
|
|
21
21
|
private portRangeManager;
|
|
22
|
-
constructor(settings:
|
|
22
|
+
constructor(settings: ISmartProxyOptions, connectionManager: ConnectionManager, securityManager: SecurityManager, domainConfigManager: DomainConfigManager, tlsManager: TlsManager, networkProxyBridge: NetworkProxyBridge, timeoutManager: TimeoutManager, portRangeManager: PortRangeManager);
|
|
23
23
|
/**
|
|
24
24
|
* Handle a new incoming connection
|
|
25
25
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type { IConnectionRecord,
|
|
2
|
+
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
|
4
4
|
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
|
5
5
|
/**
|
|
@@ -11,7 +11,7 @@ export declare class ConnectionManager {
|
|
|
11
11
|
private timeoutManager;
|
|
12
12
|
private connectionRecords;
|
|
13
13
|
private terminationStats;
|
|
14
|
-
constructor(settings:
|
|
14
|
+
constructor(settings: ISmartProxyOptions, securityManager: SecurityManager, timeoutManager: TimeoutManager);
|
|
15
15
|
/**
|
|
16
16
|
* Generate a unique connection ID
|
|
17
17
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IDomainConfig,
|
|
1
|
+
import type { IDomainConfig, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
/**
|
|
3
3
|
* Manages domain configurations and target selection
|
|
4
4
|
*/
|
|
5
5
|
export declare class DomainConfigManager {
|
|
6
6
|
private settings;
|
|
7
7
|
private domainTargetIndices;
|
|
8
|
-
constructor(settings:
|
|
8
|
+
constructor(settings: ISmartProxyOptions);
|
|
9
9
|
/**
|
|
10
10
|
* Updates the domain configurations
|
|
11
11
|
*/
|
|
@@ -19,7 +19,7 @@ export interface IDomainConfig {
|
|
|
19
19
|
}
|
|
20
20
|
/** Port proxy settings including global allowed port ranges */
|
|
21
21
|
import type { IAcmeOptions } from '../common/types.js';
|
|
22
|
-
export interface
|
|
22
|
+
export interface ISmartProxyOptions {
|
|
23
23
|
fromPort: number;
|
|
24
24
|
toPort: number;
|
|
25
25
|
targetIP?: string;
|
|
@@ -2,7 +2,7 @@ import * as plugins from '../plugins.js';
|
|
|
2
2
|
import { NetworkProxy } from '../networkproxy/classes.np.networkproxy.js';
|
|
3
3
|
import { Port80Handler } from '../port80handler/classes.port80handler.js';
|
|
4
4
|
import type { ICertificateData } from '../common/types.js';
|
|
5
|
-
import type { IConnectionRecord,
|
|
5
|
+
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
6
6
|
/**
|
|
7
7
|
* Manages NetworkProxy integration for TLS termination
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ export declare class NetworkProxyBridge {
|
|
|
10
10
|
private settings;
|
|
11
11
|
private networkProxy;
|
|
12
12
|
private port80Handler;
|
|
13
|
-
constructor(settings:
|
|
13
|
+
constructor(settings: ISmartProxyOptions);
|
|
14
14
|
/**
|
|
15
15
|
* Set the Port80Handler to use for certificate management
|
|
16
16
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
/**
|
|
3
3
|
* Manages port ranges and port-based configuration
|
|
4
4
|
*/
|
|
5
5
|
export declare class PortRangeManager {
|
|
6
6
|
private settings;
|
|
7
|
-
constructor(settings:
|
|
7
|
+
constructor(settings: ISmartProxyOptions);
|
|
8
8
|
/**
|
|
9
9
|
* Get all ports that should be listened on
|
|
10
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
/**
|
|
3
3
|
* Handles security aspects like IP tracking, rate limiting, and authorization
|
|
4
4
|
*/
|
|
@@ -6,7 +6,7 @@ export declare class SecurityManager {
|
|
|
6
6
|
private settings;
|
|
7
7
|
private connectionsByIP;
|
|
8
8
|
private connectionRateByIP;
|
|
9
|
-
constructor(settings:
|
|
9
|
+
constructor(settings: ISmartProxyOptions);
|
|
10
10
|
/**
|
|
11
11
|
* Get connections count by IP
|
|
12
12
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { IConnectionRecord,
|
|
1
|
+
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
/**
|
|
3
3
|
* Manages timeouts and inactivity tracking for connections
|
|
4
4
|
*/
|
|
5
5
|
export declare class TimeoutManager {
|
|
6
6
|
private settings;
|
|
7
|
-
constructor(settings:
|
|
7
|
+
constructor(settings: ISmartProxyOptions);
|
|
8
8
|
/**
|
|
9
9
|
* Ensure timeout values don't exceed Node.js max safe integer
|
|
10
10
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
/**
|
|
3
3
|
* Interface for connection information used for SNI extraction
|
|
4
4
|
*/
|
|
@@ -13,7 +13,7 @@ interface IConnectionInfo {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare class TlsManager {
|
|
15
15
|
private settings;
|
|
16
|
-
constructor(settings:
|
|
16
|
+
constructor(settings: ISmartProxyOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Check if a data chunk appears to be a TLS handshake
|
|
19
19
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
2
|
import { DomainConfigManager } from './classes.pp.domainconfigmanager.js';
|
|
3
|
-
import type {
|
|
4
|
-
export type { IPortProxySettings, IDomainConfig };
|
|
3
|
+
import type { ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
|
4
|
+
export type { ISmartProxyOptions as IPortProxySettings, IDomainConfig };
|
|
5
5
|
/**
|
|
6
6
|
* SmartProxy - Main class that coordinates all components
|
|
7
7
|
*/
|
|
@@ -19,11 +19,11 @@ export declare class SmartProxy extends plugins.EventEmitter {
|
|
|
19
19
|
private connectionHandler;
|
|
20
20
|
private port80Handler;
|
|
21
21
|
private certProvisioner?;
|
|
22
|
-
constructor(settingsArg:
|
|
22
|
+
constructor(settingsArg: ISmartProxyOptions);
|
|
23
23
|
/**
|
|
24
24
|
* The settings for the port proxy
|
|
25
25
|
*/
|
|
26
|
-
settings:
|
|
26
|
+
settings: ISmartProxyOptions;
|
|
27
27
|
/**
|
|
28
28
|
* Initialize the Port80Handler for ACME certificate management
|
|
29
29
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"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.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '10.0.
|
|
6
|
+
version: '10.0.7',
|
|
7
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.'
|
|
8
8
|
}
|
|
@@ -2,7 +2,7 @@ import * as plugins from '../plugins.js';
|
|
|
2
2
|
import type {
|
|
3
3
|
IConnectionRecord,
|
|
4
4
|
IDomainConfig,
|
|
5
|
-
|
|
5
|
+
ISmartProxyOptions,
|
|
6
6
|
} from './classes.pp.interfaces.js';
|
|
7
7
|
import { ConnectionManager } from './classes.pp.connectionmanager.js';
|
|
8
8
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
|
@@ -17,7 +17,7 @@ import { PortRangeManager } from './classes.pp.portrangemanager.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export class ConnectionHandler {
|
|
19
19
|
constructor(
|
|
20
|
-
private settings:
|
|
20
|
+
private settings: ISmartProxyOptions,
|
|
21
21
|
private connectionManager: ConnectionManager,
|
|
22
22
|
private securityManager: SecurityManager,
|
|
23
23
|
private domainConfigManager: DomainConfigManager,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type { IConnectionRecord,
|
|
2
|
+
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
import { SecurityManager } from './classes.pp.securitymanager.js';
|
|
4
4
|
import { TimeoutManager } from './classes.pp.timeoutmanager.js';
|
|
5
5
|
|
|
@@ -14,7 +14,7 @@ export class ConnectionManager {
|
|
|
14
14
|
} = { incoming: {}, outgoing: {} };
|
|
15
15
|
|
|
16
16
|
constructor(
|
|
17
|
-
private settings:
|
|
17
|
+
private settings: ISmartProxyOptions,
|
|
18
18
|
private securityManager: SecurityManager,
|
|
19
19
|
private timeoutManager: TimeoutManager
|
|
20
20
|
) {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type { IDomainConfig,
|
|
2
|
+
import type { IDomainConfig, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Manages domain configurations and target selection
|
|
@@ -8,7 +8,7 @@ export class DomainConfigManager {
|
|
|
8
8
|
// Track round-robin indices for domain configs
|
|
9
9
|
private domainTargetIndices: Map<IDomainConfig, number> = new Map();
|
|
10
10
|
|
|
11
|
-
constructor(private settings:
|
|
11
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Updates the domain configurations
|
|
@@ -22,7 +22,7 @@ export interface IDomainConfig {
|
|
|
22
22
|
|
|
23
23
|
/** Port proxy settings including global allowed port ranges */
|
|
24
24
|
import type { IAcmeOptions } from '../common/types.js';
|
|
25
|
-
export interface
|
|
25
|
+
export interface ISmartProxyOptions {
|
|
26
26
|
fromPort: number;
|
|
27
27
|
toPort: number;
|
|
28
28
|
targetIP?: string; // Global target host to proxy to, defaults to 'localhost'
|
|
@@ -4,7 +4,7 @@ import { Port80Handler } from '../port80handler/classes.port80handler.js';
|
|
|
4
4
|
import { Port80HandlerEvents } from '../common/types.js';
|
|
5
5
|
import { subscribeToPort80Handler } from '../common/eventUtils.js';
|
|
6
6
|
import type { ICertificateData } from '../common/types.js';
|
|
7
|
-
import type { IConnectionRecord,
|
|
7
|
+
import type { IConnectionRecord, ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Manages NetworkProxy integration for TLS termination
|
|
@@ -13,7 +13,7 @@ export class NetworkProxyBridge {
|
|
|
13
13
|
private networkProxy: NetworkProxy | null = null;
|
|
14
14
|
private port80Handler: Port80Handler | null = null;
|
|
15
15
|
|
|
16
|
-
constructor(private settings:
|
|
16
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Set the Port80Handler to use for certificate management
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type{
|
|
1
|
+
import type{ ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Manages port ranges and port-based configuration
|
|
5
5
|
*/
|
|
6
6
|
export class PortRangeManager {
|
|
7
|
-
constructor(private settings:
|
|
7
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Get all ports that should be listened on
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Handles security aspects like IP tracking, rate limiting, and authorization
|
|
@@ -8,7 +8,7 @@ export class SecurityManager {
|
|
|
8
8
|
private connectionsByIP: Map<string, Set<string>> = new Map();
|
|
9
9
|
private connectionRateByIP: Map<string, number[]> = new Map();
|
|
10
10
|
|
|
11
|
-
constructor(private settings:
|
|
11
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Get connections count by IP
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { IConnectionRecord,
|
|
1
|
+
import type { IConnectionRecord, ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Manages timeouts and inactivity tracking for connections
|
|
5
5
|
*/
|
|
6
6
|
export class TimeoutManager {
|
|
7
|
-
constructor(private settings:
|
|
7
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Ensure timeout values don't exceed Node.js max safe integer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISmartProxyOptions } from './classes.pp.interfaces.js';
|
|
3
3
|
import { SniHandler } from './classes.pp.snihandler.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -16,7 +16,7 @@ interface IConnectionInfo {
|
|
|
16
16
|
* Manages TLS-related operations including SNI extraction and validation
|
|
17
17
|
*/
|
|
18
18
|
export class TlsManager {
|
|
19
|
-
constructor(private settings:
|
|
19
|
+
constructor(private settings: ISmartProxyOptions) {}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Check if a data chunk appears to be a TLS handshake
|
|
@@ -13,8 +13,8 @@ import { CertProvisioner } from './classes.pp.certprovisioner.js';
|
|
|
13
13
|
import type { ICertificateData } from '../common/types.js';
|
|
14
14
|
import { buildPort80Handler } from '../common/acmeFactory.js';
|
|
15
15
|
|
|
16
|
-
import type {
|
|
17
|
-
export type { IPortProxySettings, IDomainConfig };
|
|
16
|
+
import type { ISmartProxyOptions, IDomainConfig } from './classes.pp.interfaces.js';
|
|
17
|
+
export type { ISmartProxyOptions as IPortProxySettings, IDomainConfig };
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* SmartProxy - Main class that coordinates all components
|
|
@@ -39,7 +39,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|
|
39
39
|
// CertProvisioner for unified certificate workflows
|
|
40
40
|
private certProvisioner?: CertProvisioner;
|
|
41
41
|
|
|
42
|
-
constructor(settingsArg:
|
|
42
|
+
constructor(settingsArg: ISmartProxyOptions) {
|
|
43
43
|
super();
|
|
44
44
|
// Set reasonable defaults for all settings
|
|
45
45
|
this.settings = {
|
|
@@ -119,7 +119,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|
|
119
119
|
/**
|
|
120
120
|
* The settings for the port proxy
|
|
121
121
|
*/
|
|
122
|
-
public settings:
|
|
122
|
+
public settings: ISmartProxyOptions;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Initialize the Port80Handler for ACME certificate management
|