@push.rocks/smartproxy 13.1.3 → 15.0.0
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 +3 -3
- package/dist_ts/proxies/smart-proxy/index.d.ts +5 -3
- package/dist_ts/proxies/smart-proxy/index.js +9 -5
- package/dist_ts/proxies/smart-proxy/models/index.d.ts +2 -0
- package/dist_ts/proxies/smart-proxy/models/index.js +2 -1
- package/dist_ts/proxies/smart-proxy/models/interfaces.d.ts +82 -15
- package/dist_ts/proxies/smart-proxy/models/interfaces.js +10 -1
- package/dist_ts/proxies/smart-proxy/models/route-types.d.ts +133 -0
- package/dist_ts/proxies/smart-proxy/models/route-types.js +2 -0
- package/dist_ts/proxies/smart-proxy/route-connection-handler.d.ts +55 -0
- package/dist_ts/proxies/smart-proxy/route-connection-handler.js +804 -0
- package/dist_ts/proxies/smart-proxy/route-helpers.d.ts +127 -0
- package/dist_ts/proxies/smart-proxy/route-helpers.js +196 -0
- package/dist_ts/proxies/smart-proxy/route-manager.d.ts +103 -0
- package/dist_ts/proxies/smart-proxy/route-manager.js +483 -0
- package/dist_ts/proxies/smart-proxy/smart-proxy.d.ts +19 -8
- package/dist_ts/proxies/smart-proxy/smart-proxy.js +239 -46
- package/package.json +2 -2
- package/readme.md +675 -446
- package/readme.plan.md +311 -250
- package/ts/00_commitinfo_data.ts +2 -2
- package/ts/proxies/smart-proxy/index.ts +20 -4
- package/ts/proxies/smart-proxy/models/index.ts +4 -0
- package/ts/proxies/smart-proxy/models/interfaces.ts +91 -13
- package/ts/proxies/smart-proxy/models/route-types.ts +184 -0
- package/ts/proxies/smart-proxy/route-connection-handler.ts +1117 -0
- package/ts/proxies/smart-proxy/route-helpers.ts +344 -0
- package/ts/proxies/smart-proxy/route-manager.ts +587 -0
- package/ts/proxies/smart-proxy/smart-proxy.ts +300 -69
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '
|
|
7
|
-
description: 'A powerful proxy package
|
|
6
|
+
version: '15.0.0',
|
|
7
|
+
description: '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.'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHFQQUFxUDtDQUNuUSxDQUFBIn0=
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SmartProxy implementation
|
|
3
|
+
*
|
|
4
|
+
* Version 14.0.0: Unified Route-Based Configuration API
|
|
3
5
|
*/
|
|
4
6
|
export * from './models/index.js';
|
|
5
7
|
export { SmartProxy } from './smart-proxy.js';
|
|
6
8
|
export { ConnectionManager } from './connection-manager.js';
|
|
7
9
|
export { SecurityManager } from './security-manager.js';
|
|
8
|
-
export { DomainConfigManager } from './domain-config-manager.js';
|
|
9
10
|
export { TimeoutManager } from './timeout-manager.js';
|
|
10
11
|
export { TlsManager } from './tls-manager.js';
|
|
11
12
|
export { NetworkProxyBridge } from './network-proxy-bridge.js';
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
13
|
+
export { RouteManager } from './route-manager.js';
|
|
14
|
+
export { RouteConnectionHandler } from './route-connection-handler.js';
|
|
15
|
+
export { createRoute, createHttpRoute, createHttpsRoute, createPassthroughRoute, createRedirectRoute, createHttpToHttpsRedirect, createBlockRoute, createLoadBalancerRoute, createHttpsServer } from './route-helpers.js';
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SmartProxy implementation
|
|
3
|
+
*
|
|
4
|
+
* Version 14.0.0: Unified Route-Based Configuration API
|
|
3
5
|
*/
|
|
4
6
|
// Re-export models
|
|
5
7
|
export * from './models/index.js';
|
|
6
8
|
// Export the main SmartProxy class
|
|
7
9
|
export { SmartProxy } from './smart-proxy.js';
|
|
8
|
-
// Export supporting classes
|
|
10
|
+
// Export core supporting classes
|
|
9
11
|
export { ConnectionManager } from './connection-manager.js';
|
|
10
12
|
export { SecurityManager } from './security-manager.js';
|
|
11
|
-
export { DomainConfigManager } from './domain-config-manager.js';
|
|
12
13
|
export { TimeoutManager } from './timeout-manager.js';
|
|
13
14
|
export { TlsManager } from './tls-manager.js';
|
|
14
15
|
export { NetworkProxyBridge } from './network-proxy-bridge.js';
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
|
|
16
|
+
// Export route-based components
|
|
17
|
+
export { RouteManager } from './route-manager.js';
|
|
18
|
+
export { RouteConnectionHandler } from './route-connection-handler.js';
|
|
19
|
+
// Export route helpers for configuration
|
|
20
|
+
export { createRoute, createHttpRoute, createHttpsRoute, createPassthroughRoute, createRedirectRoute, createHttpToHttpsRedirect, createBlockRoute, createLoadBalancerRoute, createHttpsServer } from './route-helpers.js';
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFDSCxtQkFBbUI7QUFDbkIsY0FBYyxtQkFBbUIsQ0FBQztBQUVsQyxtQ0FBbUM7QUFDbkMsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRTlDLGlDQUFpQztBQUNqQyxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM1RCxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDeEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUUvRCxnQ0FBZ0M7QUFDaEMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ2xELE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXZFLHlDQUF5QztBQUN6QyxPQUFPLEVBQ0wsV0FBVyxFQUNYLGVBQWUsRUFDZixnQkFBZ0IsRUFDaEIsc0JBQXNCLEVBQ3RCLG1CQUFtQixFQUNuQix5QkFBeUIsRUFDekIsZ0JBQWdCLEVBQ2hCLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDbEIsTUFBTSxvQkFBb0IsQ0FBQyJ9
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
* SmartProxy models
|
|
3
3
|
*/
|
|
4
4
|
export * from './interfaces.js';
|
|
5
|
-
|
|
5
|
+
export * from './route-types.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxrQkFBa0IsQ0FBQyJ9
|
|
@@ -1,29 +1,100 @@
|
|
|
1
1
|
import * as plugins from '../../../plugins.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IAcmeOptions } from '../../../certificate/models/certificate-types.js';
|
|
3
|
+
import type { IRouteConfig } from './route-types.js';
|
|
4
|
+
import type { TForwardingType } from '../../../forwarding/config/forwarding-types.js';
|
|
3
5
|
/**
|
|
4
6
|
* Provision object for static or HTTP-01 certificate
|
|
5
7
|
*/
|
|
6
8
|
export type TSmartProxyCertProvisionObject = plugins.tsclass.network.ICert | 'http01';
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
10
|
+
* Alias for backward compatibility with code that uses IRoutedSmartProxyOptions
|
|
11
|
+
*/
|
|
12
|
+
export type IRoutedSmartProxyOptions = ISmartProxyOptions;
|
|
13
|
+
/**
|
|
14
|
+
* Legacy domain configuration interface for backward compatibility
|
|
9
15
|
*/
|
|
10
16
|
export interface IDomainConfig {
|
|
11
17
|
domains: string[];
|
|
12
|
-
forwarding:
|
|
18
|
+
forwarding: {
|
|
19
|
+
type: TForwardingType;
|
|
20
|
+
target: {
|
|
21
|
+
host: string | string[];
|
|
22
|
+
port: number;
|
|
23
|
+
};
|
|
24
|
+
acme?: {
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
maintenance?: boolean;
|
|
27
|
+
production?: boolean;
|
|
28
|
+
forwardChallenges?: {
|
|
29
|
+
host: string;
|
|
30
|
+
port: number;
|
|
31
|
+
useTls?: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
http?: {
|
|
35
|
+
enabled?: boolean;
|
|
36
|
+
redirectToHttps?: boolean;
|
|
37
|
+
headers?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
https?: {
|
|
40
|
+
customCert?: {
|
|
41
|
+
key: string;
|
|
42
|
+
cert: string;
|
|
43
|
+
};
|
|
44
|
+
forwardSni?: boolean;
|
|
45
|
+
};
|
|
46
|
+
security?: {
|
|
47
|
+
allowedIps?: string[];
|
|
48
|
+
blockedIps?: string[];
|
|
49
|
+
maxConnections?: number;
|
|
50
|
+
};
|
|
51
|
+
advanced?: {
|
|
52
|
+
portRanges?: Array<{
|
|
53
|
+
from: number;
|
|
54
|
+
to: number;
|
|
55
|
+
}>;
|
|
56
|
+
networkProxyPort?: number;
|
|
57
|
+
keepAlive?: boolean;
|
|
58
|
+
timeout?: number;
|
|
59
|
+
headers?: Record<string, string>;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
13
62
|
}
|
|
14
63
|
/**
|
|
15
|
-
*
|
|
64
|
+
* Helper functions for type checking - now always assume route-based config
|
|
65
|
+
*/
|
|
66
|
+
export declare function isLegacyOptions(options: any): boolean;
|
|
67
|
+
export declare function isRoutedOptions(options: any): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* SmartProxy configuration options
|
|
16
70
|
*/
|
|
17
|
-
import type { IAcmeOptions } from '../../../certificate/models/certificate-types.js';
|
|
18
71
|
export interface ISmartProxyOptions {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
domainConfigs: IDomainConfig[];
|
|
72
|
+
routes: IRouteConfig[];
|
|
73
|
+
fromPort?: number;
|
|
74
|
+
toPort?: number;
|
|
23
75
|
sniEnabled?: boolean;
|
|
76
|
+
domainConfigs?: IDomainConfig[];
|
|
77
|
+
targetIP?: string;
|
|
24
78
|
defaultAllowedIPs?: string[];
|
|
25
79
|
defaultBlockedIPs?: string[];
|
|
80
|
+
globalPortRanges?: Array<{
|
|
81
|
+
from: number;
|
|
82
|
+
to: number;
|
|
83
|
+
}>;
|
|
84
|
+
forwardAllGlobalRanges?: boolean;
|
|
26
85
|
preserveSourceIP?: boolean;
|
|
86
|
+
defaults?: {
|
|
87
|
+
target?: {
|
|
88
|
+
host: string;
|
|
89
|
+
port: number;
|
|
90
|
+
};
|
|
91
|
+
security?: {
|
|
92
|
+
allowedIPs?: string[];
|
|
93
|
+
blockedIPs?: string[];
|
|
94
|
+
maxConnections?: number;
|
|
95
|
+
};
|
|
96
|
+
preserveSourceIP?: boolean;
|
|
97
|
+
};
|
|
27
98
|
pfx?: Buffer;
|
|
28
99
|
key?: string | Buffer | Array<Buffer | string>;
|
|
29
100
|
passphrase?: string;
|
|
@@ -42,11 +113,6 @@ export interface ISmartProxyOptions {
|
|
|
42
113
|
maxConnectionLifetime?: number;
|
|
43
114
|
inactivityTimeout?: number;
|
|
44
115
|
gracefulShutdownTimeout?: number;
|
|
45
|
-
globalPortRanges: Array<{
|
|
46
|
-
from: number;
|
|
47
|
-
to: number;
|
|
48
|
-
}>;
|
|
49
|
-
forwardAllGlobalRanges?: boolean;
|
|
50
116
|
noDelay?: boolean;
|
|
51
117
|
keepAlive?: boolean;
|
|
52
118
|
keepAliveInitialDelay?: number;
|
|
@@ -88,6 +154,7 @@ export interface IConnectionRecord {
|
|
|
88
154
|
lastActivity: number;
|
|
89
155
|
pendingData: Buffer[];
|
|
90
156
|
pendingDataSize: number;
|
|
157
|
+
domainConfig?: IDomainConfig;
|
|
91
158
|
bytesReceived: number;
|
|
92
159
|
bytesSent: number;
|
|
93
160
|
remoteIP: string;
|
|
@@ -95,7 +162,7 @@ export interface IConnectionRecord {
|
|
|
95
162
|
isTLS: boolean;
|
|
96
163
|
tlsHandshakeComplete: boolean;
|
|
97
164
|
hasReceivedInitialData: boolean;
|
|
98
|
-
|
|
165
|
+
routeConfig?: IRouteConfig;
|
|
99
166
|
hasKeepAlive: boolean;
|
|
100
167
|
inactivityWarningIssued?: boolean;
|
|
101
168
|
incomingTerminationReason?: string | null;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import * as plugins from '../../../plugins.js';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Helper functions for type checking - now always assume route-based config
|
|
4
|
+
*/
|
|
5
|
+
export function isLegacyOptions(options) {
|
|
6
|
+
return false; // No longer supporting legacy options
|
|
7
|
+
}
|
|
8
|
+
export function isRoutedOptions(options) {
|
|
9
|
+
return true; // Always assume routed options
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3RzL3Byb3hpZXMvc21hcnQtcHJveHkvbW9kZWxzL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxxQkFBcUIsQ0FBQztBQStEL0M7O0dBRUc7QUFDSCxNQUFNLFVBQVUsZUFBZSxDQUFDLE9BQVk7SUFDMUMsT0FBTyxLQUFLLENBQUMsQ0FBQyxzQ0FBc0M7QUFDdEQsQ0FBQztBQUVELE1BQU0sVUFBVSxlQUFlLENBQUMsT0FBWTtJQUMxQyxPQUFPLElBQUksQ0FBQyxDQUFDLCtCQUErQjtBQUM5QyxDQUFDIn0=
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import type { IAcmeOptions } from '../../../certificate/models/certificate-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Supported action types for route configurations
|
|
4
|
+
*/
|
|
5
|
+
export type TRouteActionType = 'forward' | 'redirect' | 'block';
|
|
6
|
+
/**
|
|
7
|
+
* TLS handling modes for route configurations
|
|
8
|
+
*/
|
|
9
|
+
export type TTlsMode = 'passthrough' | 'terminate' | 'terminate-and-reencrypt';
|
|
10
|
+
/**
|
|
11
|
+
* Port range specification format
|
|
12
|
+
*/
|
|
13
|
+
export type TPortRange = number | number[] | Array<{
|
|
14
|
+
from: number;
|
|
15
|
+
to: number;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Route match criteria for incoming requests
|
|
19
|
+
*/
|
|
20
|
+
export interface IRouteMatch {
|
|
21
|
+
ports: TPortRange;
|
|
22
|
+
domains?: string | string[];
|
|
23
|
+
path?: string;
|
|
24
|
+
clientIp?: string[];
|
|
25
|
+
tlsVersion?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Target configuration for forwarding
|
|
29
|
+
*/
|
|
30
|
+
export interface IRouteTarget {
|
|
31
|
+
host: string | string[];
|
|
32
|
+
port: number;
|
|
33
|
+
preservePort?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* TLS configuration for route actions
|
|
37
|
+
*/
|
|
38
|
+
export interface IRouteTls {
|
|
39
|
+
mode: TTlsMode;
|
|
40
|
+
certificate?: 'auto' | {
|
|
41
|
+
key: string;
|
|
42
|
+
cert: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Redirect configuration for route actions
|
|
47
|
+
*/
|
|
48
|
+
export interface IRouteRedirect {
|
|
49
|
+
to: string;
|
|
50
|
+
status: 301 | 302 | 307 | 308;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Security options for route actions
|
|
54
|
+
*/
|
|
55
|
+
export interface IRouteSecurity {
|
|
56
|
+
allowedIps?: string[];
|
|
57
|
+
blockedIps?: string[];
|
|
58
|
+
maxConnections?: number;
|
|
59
|
+
authentication?: {
|
|
60
|
+
type: 'basic' | 'digest' | 'oauth';
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Advanced options for route actions
|
|
65
|
+
*/
|
|
66
|
+
export interface IRouteAdvanced {
|
|
67
|
+
timeout?: number;
|
|
68
|
+
headers?: Record<string, string>;
|
|
69
|
+
keepAlive?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Action configuration for route handling
|
|
73
|
+
*/
|
|
74
|
+
export interface IRouteAction {
|
|
75
|
+
type: TRouteActionType;
|
|
76
|
+
target?: IRouteTarget;
|
|
77
|
+
tls?: IRouteTls;
|
|
78
|
+
redirect?: IRouteRedirect;
|
|
79
|
+
security?: IRouteSecurity;
|
|
80
|
+
advanced?: IRouteAdvanced;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The core unified configuration interface
|
|
84
|
+
*/
|
|
85
|
+
export interface IRouteConfig {
|
|
86
|
+
match: IRouteMatch;
|
|
87
|
+
action: IRouteAction;
|
|
88
|
+
name?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
priority?: number;
|
|
91
|
+
tags?: string[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Unified SmartProxy options with routes-based configuration
|
|
95
|
+
*/
|
|
96
|
+
export interface IRoutedSmartProxyOptions {
|
|
97
|
+
routes: IRouteConfig[];
|
|
98
|
+
defaults?: {
|
|
99
|
+
target?: {
|
|
100
|
+
host: string;
|
|
101
|
+
port: number;
|
|
102
|
+
};
|
|
103
|
+
security?: IRouteSecurity;
|
|
104
|
+
tls?: IRouteTls;
|
|
105
|
+
};
|
|
106
|
+
acme?: IAcmeOptions;
|
|
107
|
+
initialDataTimeout?: number;
|
|
108
|
+
socketTimeout?: number;
|
|
109
|
+
inactivityCheckInterval?: number;
|
|
110
|
+
maxConnectionLifetime?: number;
|
|
111
|
+
inactivityTimeout?: number;
|
|
112
|
+
gracefulShutdownTimeout?: number;
|
|
113
|
+
noDelay?: boolean;
|
|
114
|
+
keepAlive?: boolean;
|
|
115
|
+
keepAliveInitialDelay?: number;
|
|
116
|
+
maxPendingDataSize?: number;
|
|
117
|
+
disableInactivityCheck?: boolean;
|
|
118
|
+
enableKeepAliveProbes?: boolean;
|
|
119
|
+
enableDetailedLogging?: boolean;
|
|
120
|
+
enableTlsDebugLogging?: boolean;
|
|
121
|
+
enableRandomizedTimeouts?: boolean;
|
|
122
|
+
allowSessionTicket?: boolean;
|
|
123
|
+
maxConnectionsPerIP?: number;
|
|
124
|
+
connectionRateLimitPerMinute?: number;
|
|
125
|
+
keepAliveTreatment?: 'standard' | 'extended' | 'immortal';
|
|
126
|
+
keepAliveInactivityMultiplier?: number;
|
|
127
|
+
extendedKeepAliveLifetime?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Optional certificate provider callback. Return 'http01' to use HTTP-01 challenges,
|
|
130
|
+
* or a static certificate object for immediate provisioning.
|
|
131
|
+
*/
|
|
132
|
+
certProvisionFunction?: (domain: string) => Promise<any>;
|
|
133
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../../../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtdHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L21vZGVscy9yb3V0ZS10eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHFCQUFxQixDQUFDIn0=
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as plugins from '../../plugins.js';
|
|
2
|
+
import type { ISmartProxyOptions } from './models/interfaces.js';
|
|
3
|
+
import { ConnectionManager } from './connection-manager.js';
|
|
4
|
+
import { SecurityManager } from './security-manager.js';
|
|
5
|
+
import { DomainConfigManager } from './domain-config-manager.js';
|
|
6
|
+
import { TlsManager } from './tls-manager.js';
|
|
7
|
+
import { NetworkProxyBridge } from './network-proxy-bridge.js';
|
|
8
|
+
import { TimeoutManager } from './timeout-manager.js';
|
|
9
|
+
import { RouteManager } from './route-manager.js';
|
|
10
|
+
/**
|
|
11
|
+
* Handles new connection processing and setup logic with support for route-based configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare class RouteConnectionHandler {
|
|
14
|
+
private connectionManager;
|
|
15
|
+
private securityManager;
|
|
16
|
+
private domainConfigManager;
|
|
17
|
+
private tlsManager;
|
|
18
|
+
private networkProxyBridge;
|
|
19
|
+
private timeoutManager;
|
|
20
|
+
private routeManager;
|
|
21
|
+
private settings;
|
|
22
|
+
constructor(settings: ISmartProxyOptions, connectionManager: ConnectionManager, securityManager: SecurityManager, domainConfigManager: DomainConfigManager, tlsManager: TlsManager, networkProxyBridge: NetworkProxyBridge, timeoutManager: TimeoutManager, routeManager: RouteManager);
|
|
23
|
+
/**
|
|
24
|
+
* Handle a new incoming connection
|
|
25
|
+
*/
|
|
26
|
+
handleConnection(socket: plugins.net.Socket): void;
|
|
27
|
+
/**
|
|
28
|
+
* Handle a connection and wait for TLS handshake for SNI extraction if needed
|
|
29
|
+
*/
|
|
30
|
+
private handleTlsConnection;
|
|
31
|
+
/**
|
|
32
|
+
* Route the connection based on match criteria
|
|
33
|
+
*/
|
|
34
|
+
private routeConnection;
|
|
35
|
+
/**
|
|
36
|
+
* Handle a forward action for a route
|
|
37
|
+
*/
|
|
38
|
+
private handleForwardAction;
|
|
39
|
+
/**
|
|
40
|
+
* Handle a redirect action for a route
|
|
41
|
+
*/
|
|
42
|
+
private handleRedirectAction;
|
|
43
|
+
/**
|
|
44
|
+
* Handle a block action for a route
|
|
45
|
+
*/
|
|
46
|
+
private handleBlockAction;
|
|
47
|
+
/**
|
|
48
|
+
* Handle a connection using legacy domain configuration
|
|
49
|
+
*/
|
|
50
|
+
private handleLegacyConnection;
|
|
51
|
+
/**
|
|
52
|
+
* Sets up a direct connection to the target
|
|
53
|
+
*/
|
|
54
|
+
private setupDirectConnection;
|
|
55
|
+
}
|