@push.rocks/smartproxy 19.5.19 → 19.5.21
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/core/models/index.d.ts +2 -0
- package/dist_ts/core/models/index.js +3 -1
- package/dist_ts/core/models/socket-types.d.ts +14 -0
- package/dist_ts/core/models/socket-types.js +15 -0
- package/dist_ts/core/models/wrapped-socket.d.ts +34 -0
- package/dist_ts/core/models/wrapped-socket.js +82 -0
- package/dist_ts/core/routing/index.d.ts +11 -0
- package/dist_ts/core/routing/index.js +17 -0
- package/dist_ts/core/routing/matchers/domain.d.ts +34 -0
- package/dist_ts/core/routing/matchers/domain.js +91 -0
- package/dist_ts/core/routing/matchers/header.d.ts +32 -0
- package/dist_ts/core/routing/matchers/header.js +94 -0
- package/dist_ts/core/routing/matchers/index.d.ts +18 -0
- package/dist_ts/core/routing/matchers/index.js +20 -0
- package/dist_ts/core/routing/matchers/ip.d.ts +53 -0
- package/dist_ts/core/routing/matchers/ip.js +169 -0
- package/dist_ts/core/routing/matchers/path.d.ts +44 -0
- package/dist_ts/core/routing/matchers/path.js +148 -0
- package/dist_ts/core/routing/route-manager.d.ts +88 -0
- package/dist_ts/core/routing/route-manager.js +342 -0
- package/dist_ts/core/routing/route-utils.d.ts +28 -0
- package/dist_ts/core/routing/route-utils.js +67 -0
- package/dist_ts/core/routing/specificity.d.ts +30 -0
- package/dist_ts/core/routing/specificity.js +115 -0
- package/dist_ts/core/routing/types.d.ts +41 -0
- package/dist_ts/core/routing/types.js +5 -0
- package/dist_ts/core/utils/index.d.ts +1 -2
- package/dist_ts/core/utils/index.js +2 -3
- package/dist_ts/core/utils/proxy-protocol.d.ts +45 -0
- package/dist_ts/core/utils/proxy-protocol.js +201 -0
- package/dist_ts/core/utils/route-manager.d.ts +0 -30
- package/dist_ts/core/utils/route-manager.js +6 -47
- package/dist_ts/core/utils/route-utils.d.ts +2 -68
- package/dist_ts/core/utils/route-utils.js +21 -218
- package/dist_ts/core/utils/security-utils.js +4 -4
- package/dist_ts/index.d.ts +2 -5
- package/dist_ts/index.js +5 -11
- package/dist_ts/proxies/http-proxy/http-proxy.d.ts +0 -1
- package/dist_ts/proxies/http-proxy/http-proxy.js +15 -60
- package/dist_ts/proxies/http-proxy/models/types.d.ts +0 -90
- package/dist_ts/proxies/http-proxy/models/types.js +1 -242
- package/dist_ts/proxies/http-proxy/request-handler.d.ts +3 -5
- package/dist_ts/proxies/http-proxy/request-handler.js +20 -171
- package/dist_ts/proxies/http-proxy/websocket-handler.d.ts +2 -5
- package/dist_ts/proxies/http-proxy/websocket-handler.js +15 -23
- package/dist_ts/proxies/index.d.ts +2 -2
- package/dist_ts/proxies/index.js +4 -3
- package/dist_ts/proxies/smart-proxy/connection-manager.d.ts +3 -1
- package/dist_ts/proxies/smart-proxy/connection-manager.js +17 -7
- package/dist_ts/proxies/smart-proxy/http-proxy-bridge.d.ts +2 -1
- package/dist_ts/proxies/smart-proxy/http-proxy-bridge.js +5 -2
- package/dist_ts/proxies/smart-proxy/index.d.ts +1 -1
- package/dist_ts/proxies/smart-proxy/index.js +2 -2
- package/dist_ts/proxies/smart-proxy/models/interfaces.d.ts +7 -2
- package/dist_ts/proxies/smart-proxy/models/route-types.d.ts +1 -0
- package/dist_ts/proxies/smart-proxy/models/route-types.js +1 -1
- package/dist_ts/proxies/smart-proxy/route-connection-handler.d.ts +1 -1
- package/dist_ts/proxies/smart-proxy/route-connection-handler.js +155 -35
- package/dist_ts/proxies/smart-proxy/smart-proxy.d.ts +1 -1
- package/dist_ts/proxies/smart-proxy/smart-proxy.js +15 -4
- package/dist_ts/proxies/smart-proxy/utils/route-utils.js +10 -43
- package/dist_ts/routing/router/http-router.d.ts +89 -0
- package/dist_ts/routing/router/http-router.js +205 -0
- package/dist_ts/routing/router/index.d.ts +2 -5
- package/dist_ts/routing/router/index.js +3 -4
- package/package.json +1 -1
- package/readme.delete.md +187 -0
- package/readme.hints.md +196 -1
- package/readme.plan.md +625 -0
- package/readme.proxy-chain-summary.md +112 -0
- package/readme.proxy-protocol-example.md +462 -0
- package/readme.proxy-protocol.md +415 -0
- package/readme.routing.md +341 -0
- package/ts/core/models/index.ts +2 -0
- package/ts/core/models/socket-types.ts +21 -0
- package/ts/core/models/wrapped-socket.ts +99 -0
- package/ts/core/routing/index.ts +21 -0
- package/ts/core/routing/matchers/domain.ts +119 -0
- package/ts/core/routing/matchers/header.ts +120 -0
- package/ts/core/routing/matchers/index.ts +22 -0
- package/ts/core/routing/matchers/ip.ts +207 -0
- package/ts/core/routing/matchers/path.ts +184 -0
- package/ts/core/{utils → routing}/route-manager.ts +7 -57
- package/ts/core/routing/route-utils.ts +88 -0
- package/ts/core/routing/specificity.ts +141 -0
- package/ts/core/routing/types.ts +49 -0
- package/ts/core/utils/index.ts +1 -2
- package/ts/core/utils/proxy-protocol.ts +246 -0
- package/ts/core/utils/security-utils.ts +3 -7
- package/ts/index.ts +4 -14
- package/ts/proxies/http-proxy/http-proxy.ts +13 -68
- package/ts/proxies/http-proxy/models/types.ts +0 -324
- package/ts/proxies/http-proxy/request-handler.ts +15 -186
- package/ts/proxies/http-proxy/websocket-handler.ts +15 -26
- package/ts/proxies/index.ts +3 -2
- package/ts/proxies/smart-proxy/connection-manager.ts +17 -7
- package/ts/proxies/smart-proxy/http-proxy-bridge.ts +6 -2
- package/ts/proxies/smart-proxy/index.ts +1 -1
- package/ts/proxies/smart-proxy/models/interfaces.ts +9 -2
- package/ts/proxies/smart-proxy/models/route-types.ts +3 -0
- package/ts/proxies/smart-proxy/route-connection-handler.ts +173 -42
- package/ts/proxies/smart-proxy/smart-proxy.ts +15 -3
- package/ts/proxies/smart-proxy/utils/route-utils.ts +11 -49
- package/ts/routing/router/http-router.ts +266 -0
- package/ts/routing/router/index.ts +3 -8
- package/readme.problems.md +0 -170
- package/ts/core/utils/route-utils.ts +0 -312
- package/ts/proxies/smart-proxy/route-manager.ts +0 -554
- package/ts/routing/router/proxy-router.ts +0 -437
- package/ts/routing/router/route-router.ts +0 -482
|
@@ -12,7 +12,6 @@ export interface IAcmeOptions {
|
|
|
12
12
|
skipConfiguredCerts?: boolean;
|
|
13
13
|
}
|
|
14
14
|
import type { IRouteConfig } from '../../smart-proxy/models/route-types.js';
|
|
15
|
-
import type { IRouteContext } from '../../../core/models/route-context.js';
|
|
16
15
|
/**
|
|
17
16
|
* Configuration options for HttpProxy
|
|
18
17
|
*/
|
|
@@ -30,7 +29,6 @@ export interface IHttpProxyOptions {
|
|
|
30
29
|
};
|
|
31
30
|
connectionPoolSize?: number;
|
|
32
31
|
portProxyIntegration?: boolean;
|
|
33
|
-
useExternalPort80Handler?: boolean;
|
|
34
32
|
backendProtocol?: 'http1' | 'http2';
|
|
35
33
|
functionCacheSize?: number;
|
|
36
34
|
functionCacheTtl?: number;
|
|
@@ -45,94 +43,6 @@ export interface ICertificateEntry {
|
|
|
45
43
|
cert: string;
|
|
46
44
|
expires?: Date;
|
|
47
45
|
}
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use IRouteConfig instead. This interface will be removed in a future release.
|
|
50
|
-
*
|
|
51
|
-
* IMPORTANT: This is a legacy interface maintained only for backward compatibility.
|
|
52
|
-
* New code should use IRouteConfig for all configuration purposes.
|
|
53
|
-
*
|
|
54
|
-
* @see IRouteConfig for the modern, recommended configuration format
|
|
55
|
-
*/
|
|
56
|
-
export interface IReverseProxyConfig {
|
|
57
|
-
/** Target hostnames/IPs to proxy requests to */
|
|
58
|
-
destinationIps: string[];
|
|
59
|
-
/** Target ports to proxy requests to */
|
|
60
|
-
destinationPorts: number[];
|
|
61
|
-
/** Hostname to match for routing */
|
|
62
|
-
hostName: string;
|
|
63
|
-
/** SSL private key for this host (PEM format) */
|
|
64
|
-
privateKey: string;
|
|
65
|
-
/** SSL public key/certificate for this host (PEM format) */
|
|
66
|
-
publicKey: string;
|
|
67
|
-
/** Basic authentication configuration */
|
|
68
|
-
authentication?: {
|
|
69
|
-
type: 'Basic';
|
|
70
|
-
user: string;
|
|
71
|
-
pass: string;
|
|
72
|
-
};
|
|
73
|
-
/** Whether to rewrite the Host header to match the target */
|
|
74
|
-
rewriteHostHeader?: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Protocol to use when proxying to this backend: 'http1' or 'http2'.
|
|
77
|
-
* Overrides the global backendProtocol option if set.
|
|
78
|
-
*/
|
|
79
|
-
backendProtocol?: 'http1' | 'http2';
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Convert a legacy IReverseProxyConfig to the modern IRouteConfig format
|
|
83
|
-
*
|
|
84
|
-
* @deprecated This function is maintained for backward compatibility.
|
|
85
|
-
* New code should create IRouteConfig objects directly.
|
|
86
|
-
*
|
|
87
|
-
* @param legacyConfig The legacy configuration to convert
|
|
88
|
-
* @param proxyPort The port the proxy listens on
|
|
89
|
-
* @returns A modern route configuration equivalent to the legacy config
|
|
90
|
-
*/
|
|
91
|
-
export declare function convertLegacyConfigToRouteConfig(legacyConfig: IReverseProxyConfig, proxyPort: number): IRouteConfig;
|
|
92
|
-
/**
|
|
93
|
-
* Route manager for NetworkProxy
|
|
94
|
-
* Handles route matching and configuration
|
|
95
|
-
*/
|
|
96
|
-
export declare class RouteManager {
|
|
97
|
-
private routes;
|
|
98
|
-
private logger;
|
|
99
|
-
constructor(logger: ILogger);
|
|
100
|
-
/**
|
|
101
|
-
* Update the routes configuration
|
|
102
|
-
*/
|
|
103
|
-
updateRoutes(routes: IRouteConfig[]): void;
|
|
104
|
-
/**
|
|
105
|
-
* Get all routes
|
|
106
|
-
*/
|
|
107
|
-
getRoutes(): IRouteConfig[];
|
|
108
|
-
/**
|
|
109
|
-
* Find the first matching route for a context
|
|
110
|
-
*/
|
|
111
|
-
findMatchingRoute(context: IRouteContext): IRouteConfig | null;
|
|
112
|
-
/**
|
|
113
|
-
* Check if a route matches the given context
|
|
114
|
-
*/
|
|
115
|
-
private matchesRoute;
|
|
116
|
-
/**
|
|
117
|
-
* Match a domain pattern against a domain
|
|
118
|
-
*/
|
|
119
|
-
private matchDomain;
|
|
120
|
-
/**
|
|
121
|
-
* Match a path pattern against a path
|
|
122
|
-
*/
|
|
123
|
-
private matchPath;
|
|
124
|
-
/**
|
|
125
|
-
* Match an IP pattern against an IP
|
|
126
|
-
* Supports exact matches, wildcard patterns, and CIDR notation
|
|
127
|
-
*/
|
|
128
|
-
private matchIp;
|
|
129
|
-
/**
|
|
130
|
-
* Convert an IP address to its binary representation
|
|
131
|
-
* @param ip The IP address to convert
|
|
132
|
-
* @returns Binary string representation or null if invalid
|
|
133
|
-
*/
|
|
134
|
-
private ipToBinary;
|
|
135
|
-
}
|
|
136
46
|
/**
|
|
137
47
|
* Interface for connection tracking in the pool
|
|
138
48
|
*/
|
|
@@ -1,245 +1,4 @@
|
|
|
1
1
|
import * as plugins from '../../../plugins.js';
|
|
2
|
-
/**
|
|
3
|
-
* Convert a legacy IReverseProxyConfig to the modern IRouteConfig format
|
|
4
|
-
*
|
|
5
|
-
* @deprecated This function is maintained for backward compatibility.
|
|
6
|
-
* New code should create IRouteConfig objects directly.
|
|
7
|
-
*
|
|
8
|
-
* @param legacyConfig The legacy configuration to convert
|
|
9
|
-
* @param proxyPort The port the proxy listens on
|
|
10
|
-
* @returns A modern route configuration equivalent to the legacy config
|
|
11
|
-
*/
|
|
12
|
-
export function convertLegacyConfigToRouteConfig(legacyConfig, proxyPort) {
|
|
13
|
-
// Create basic route configuration
|
|
14
|
-
const routeConfig = {
|
|
15
|
-
// Match properties
|
|
16
|
-
match: {
|
|
17
|
-
ports: proxyPort,
|
|
18
|
-
domains: legacyConfig.hostName
|
|
19
|
-
},
|
|
20
|
-
// Action properties
|
|
21
|
-
action: {
|
|
22
|
-
type: 'forward',
|
|
23
|
-
target: {
|
|
24
|
-
host: legacyConfig.destinationIps,
|
|
25
|
-
port: legacyConfig.destinationPorts[0]
|
|
26
|
-
},
|
|
27
|
-
// TLS mode is always 'terminate' for legacy configs
|
|
28
|
-
tls: {
|
|
29
|
-
mode: 'terminate',
|
|
30
|
-
certificate: {
|
|
31
|
-
key: legacyConfig.privateKey,
|
|
32
|
-
cert: legacyConfig.publicKey
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
// Advanced options
|
|
36
|
-
advanced: {
|
|
37
|
-
// Rewrite host header if specified
|
|
38
|
-
headers: legacyConfig.rewriteHostHeader ? { 'host': '{domain}' } : {}
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
// Metadata
|
|
42
|
-
name: `Legacy Config - ${legacyConfig.hostName}`,
|
|
43
|
-
priority: 0, // Default priority
|
|
44
|
-
enabled: true
|
|
45
|
-
};
|
|
46
|
-
// Add authentication if present
|
|
47
|
-
if (legacyConfig.authentication) {
|
|
48
|
-
routeConfig.security = {
|
|
49
|
-
authentication: {
|
|
50
|
-
type: 'basic',
|
|
51
|
-
credentials: [{
|
|
52
|
-
username: legacyConfig.authentication.user,
|
|
53
|
-
password: legacyConfig.authentication.pass
|
|
54
|
-
}]
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// Add backend protocol if specified
|
|
59
|
-
if (legacyConfig.backendProtocol) {
|
|
60
|
-
if (!routeConfig.action.options) {
|
|
61
|
-
routeConfig.action.options = {};
|
|
62
|
-
}
|
|
63
|
-
routeConfig.action.options.backendProtocol = legacyConfig.backendProtocol;
|
|
64
|
-
}
|
|
65
|
-
return routeConfig;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Route manager for NetworkProxy
|
|
69
|
-
* Handles route matching and configuration
|
|
70
|
-
*/
|
|
71
|
-
export class RouteManager {
|
|
72
|
-
constructor(logger) {
|
|
73
|
-
this.routes = [];
|
|
74
|
-
this.logger = logger;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Update the routes configuration
|
|
78
|
-
*/
|
|
79
|
-
updateRoutes(routes) {
|
|
80
|
-
// Sort routes by priority (higher first)
|
|
81
|
-
this.routes = [...routes].sort((a, b) => {
|
|
82
|
-
const priorityA = a.priority ?? 0;
|
|
83
|
-
const priorityB = b.priority ?? 0;
|
|
84
|
-
return priorityB - priorityA;
|
|
85
|
-
});
|
|
86
|
-
this.logger.info(`Updated RouteManager with ${this.routes.length} routes`);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get all routes
|
|
90
|
-
*/
|
|
91
|
-
getRoutes() {
|
|
92
|
-
return [...this.routes];
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Find the first matching route for a context
|
|
96
|
-
*/
|
|
97
|
-
findMatchingRoute(context) {
|
|
98
|
-
for (const route of this.routes) {
|
|
99
|
-
if (this.matchesRoute(route, context)) {
|
|
100
|
-
return route;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Check if a route matches the given context
|
|
107
|
-
*/
|
|
108
|
-
matchesRoute(route, context) {
|
|
109
|
-
// Skip disabled routes
|
|
110
|
-
if (route.enabled === false) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
// Check domain match if specified
|
|
114
|
-
if (route.match.domains && context.domain) {
|
|
115
|
-
const domains = Array.isArray(route.match.domains)
|
|
116
|
-
? route.match.domains
|
|
117
|
-
: [route.match.domains];
|
|
118
|
-
if (!domains.some(domainPattern => this.matchDomain(domainPattern, context.domain))) {
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
// Check path match if specified
|
|
123
|
-
if (route.match.path && context.path) {
|
|
124
|
-
if (!this.matchPath(route.match.path, context.path)) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// Check client IP match if specified
|
|
129
|
-
if (route.match.clientIp && context.clientIp) {
|
|
130
|
-
if (!route.match.clientIp.some(ip => this.matchIp(ip, context.clientIp))) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
// Check TLS version match if specified
|
|
135
|
-
if (route.match.tlsVersion && context.tlsVersion) {
|
|
136
|
-
if (!route.match.tlsVersion.includes(context.tlsVersion)) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
// All criteria matched
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Match a domain pattern against a domain
|
|
145
|
-
*/
|
|
146
|
-
matchDomain(pattern, domain) {
|
|
147
|
-
if (pattern === domain) {
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
if (pattern.includes('*')) {
|
|
151
|
-
const regexPattern = pattern
|
|
152
|
-
.replace(/\./g, '\\.')
|
|
153
|
-
.replace(/\*/g, '.*');
|
|
154
|
-
const regex = new RegExp(`^${regexPattern}$`, 'i');
|
|
155
|
-
return regex.test(domain);
|
|
156
|
-
}
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* Match a path pattern against a path
|
|
161
|
-
*/
|
|
162
|
-
matchPath(pattern, path) {
|
|
163
|
-
if (pattern === path) {
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
|
-
if (pattern.endsWith('*')) {
|
|
167
|
-
const prefix = pattern.slice(0, -1);
|
|
168
|
-
return path.startsWith(prefix);
|
|
169
|
-
}
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Match an IP pattern against an IP
|
|
174
|
-
* Supports exact matches, wildcard patterns, and CIDR notation
|
|
175
|
-
*/
|
|
176
|
-
matchIp(pattern, ip) {
|
|
177
|
-
// Exact match
|
|
178
|
-
if (pattern === ip) {
|
|
179
|
-
return true;
|
|
180
|
-
}
|
|
181
|
-
// Wildcard matching (e.g., 192.168.0.*)
|
|
182
|
-
if (pattern.includes('*')) {
|
|
183
|
-
const regexPattern = pattern
|
|
184
|
-
.replace(/\./g, '\\.')
|
|
185
|
-
.replace(/\*/g, '.*');
|
|
186
|
-
const regex = new RegExp(`^${regexPattern}$`);
|
|
187
|
-
return regex.test(ip);
|
|
188
|
-
}
|
|
189
|
-
// CIDR matching (e.g., 192.168.0.0/24)
|
|
190
|
-
if (pattern.includes('/')) {
|
|
191
|
-
try {
|
|
192
|
-
const [subnet, bits] = pattern.split('/');
|
|
193
|
-
// Convert IP addresses to numeric format for comparison
|
|
194
|
-
const ipBinary = this.ipToBinary(ip);
|
|
195
|
-
const subnetBinary = this.ipToBinary(subnet);
|
|
196
|
-
if (!ipBinary || !subnetBinary) {
|
|
197
|
-
return false;
|
|
198
|
-
}
|
|
199
|
-
// Get the subnet mask from CIDR notation
|
|
200
|
-
const mask = parseInt(bits, 10);
|
|
201
|
-
if (isNaN(mask) || mask < 0 || mask > 32) {
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
// Check if the first 'mask' bits match between IP and subnet
|
|
205
|
-
return ipBinary.slice(0, mask) === subnetBinary.slice(0, mask);
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
// If we encounter any error during CIDR matching, return false
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Convert an IP address to its binary representation
|
|
216
|
-
* @param ip The IP address to convert
|
|
217
|
-
* @returns Binary string representation or null if invalid
|
|
218
|
-
*/
|
|
219
|
-
ipToBinary(ip) {
|
|
220
|
-
// Handle IPv4 addresses only for now
|
|
221
|
-
const parts = ip.split('.');
|
|
222
|
-
// Validate IP format
|
|
223
|
-
if (parts.length !== 4) {
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
// Convert each octet to 8-bit binary and concatenate
|
|
227
|
-
try {
|
|
228
|
-
return parts
|
|
229
|
-
.map(part => {
|
|
230
|
-
const num = parseInt(part, 10);
|
|
231
|
-
if (isNaN(num) || num < 0 || num > 255) {
|
|
232
|
-
throw new Error('Invalid IP octet');
|
|
233
|
-
}
|
|
234
|
-
return num.toString(2).padStart(8, '0');
|
|
235
|
-
})
|
|
236
|
-
.join('');
|
|
237
|
-
}
|
|
238
|
-
catch (error) {
|
|
239
|
-
return null;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
2
|
/**
|
|
244
3
|
* Creates a logger based on the specified log level
|
|
245
4
|
*/
|
|
@@ -273,4 +32,4 @@ export function createLogger(logLevel = 'info') {
|
|
|
273
32
|
}
|
|
274
33
|
};
|
|
275
34
|
}
|
|
276
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL2h0dHAtcHJveHkvbW9kZWxzL3R5cGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0scUJBQXFCLENBQUM7QUF1Ri9DOztHQUVHO0FBQ0gsTUFBTSxVQUFVLFlBQVksQ0FBQyxXQUFtQixNQUFNO0lBQ3BELE1BQU0sU0FBUyxHQUFHO1FBQ2hCLEtBQUssRUFBRSxDQUFDO1FBQ1IsSUFBSSxFQUFFLENBQUM7UUFDUCxJQUFJLEVBQUUsQ0FBQztRQUNQLEtBQUssRUFBRSxDQUFDO0tBQ1QsQ0FBQztJQUVGLE9BQU87UUFDTCxLQUFLLEVBQUUsQ0FBQyxPQUFlLEVBQUUsSUFBVSxFQUFFLEVBQUU7WUFDckMsSUFBSSxTQUFTLENBQUMsUUFBUSxDQUFDLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxDQUFDO2dCQUMzQyxPQUFPLENBQUMsR0FBRyxDQUFDLFdBQVcsT0FBTyxFQUFFLEVBQUUsSUFBSSxJQUFJLEVBQUUsQ0FBQyxDQUFDO1lBQ2hELENBQUM7UUFDSCxDQUFDO1FBQ0QsSUFBSSxFQUFFLENBQUMsT0FBZSxFQUFFLElBQVUsRUFBRSxFQUFFO1lBQ3BDLElBQUksU0FBUyxDQUFDLFFBQVEsQ0FBQyxJQUFJLFNBQVMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztnQkFDMUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxVQUFVLE9BQU8sRUFBRSxFQUFFLElBQUksSUFBSSxFQUFFLENBQUMsQ0FBQztZQUMvQyxDQUFDO1FBQ0gsQ0FBQztRQUNELElBQUksRUFBRSxDQUFDLE9BQWUsRUFBRSxJQUFVLEVBQUUsRUFBRTtZQUNwQyxJQUFJLFNBQVMsQ0FBQyxRQUFRLENBQUMsSUFBSSxTQUFTLENBQUMsSUFBSSxFQUFFLENBQUM7Z0JBQzFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsVUFBVSxPQUFPLEVBQUUsRUFBRSxJQUFJLElBQUksRUFBRSxDQUFDLENBQUM7WUFDaEQsQ0FBQztRQUNILENBQUM7UUFDRCxLQUFLLEVBQUUsQ0FBQyxPQUFlLEVBQUUsSUFBVSxFQUFFLEVBQUU7WUFDckMsSUFBSSxTQUFTLENBQUMsUUFBUSxDQUFDLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRSxDQUFDO2dCQUMzQyxPQUFPLENBQUMsS0FBSyxDQUFDLFdBQVcsT0FBTyxFQUFFLEVBQUUsSUFBSSxJQUFJLEVBQUUsQ0FBQyxDQUFDO1lBQ2xELENBQUM7UUFDSCxDQUFDO0tBQ0YsQ0FBQztBQUNKLENBQUMifQ==
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as plugins from '../../plugins.js';
|
|
2
2
|
import '../../core/models/socket-augmentation.js';
|
|
3
|
-
import { type IHttpProxyOptions
|
|
3
|
+
import { type IHttpProxyOptions } from './models/types.js';
|
|
4
|
+
import { SharedRouteManager as RouteManager } from '../../core/routing/route-manager.js';
|
|
4
5
|
import { ConnectionPool } from './connection-pool.js';
|
|
5
|
-
import { ProxyRouter } from '../../routing/router/index.js';
|
|
6
6
|
import { SecurityManager } from './security-manager.js';
|
|
7
7
|
/**
|
|
8
8
|
* Interface for tracking metrics
|
|
@@ -18,7 +18,6 @@ export type MetricsTracker = IMetricsTracker;
|
|
|
18
18
|
export declare class RequestHandler {
|
|
19
19
|
private options;
|
|
20
20
|
private connectionPool;
|
|
21
|
-
private legacyRouter;
|
|
22
21
|
private routeManager?;
|
|
23
22
|
private functionCache?;
|
|
24
23
|
private router?;
|
|
@@ -28,8 +27,7 @@ export declare class RequestHandler {
|
|
|
28
27
|
private h2Sessions;
|
|
29
28
|
private contextCreator;
|
|
30
29
|
securityManager: SecurityManager;
|
|
31
|
-
constructor(options: IHttpProxyOptions, connectionPool: ConnectionPool,
|
|
32
|
-
routeManager?: RouteManager, functionCache?: any, // FunctionCache - using any to avoid circular dependency
|
|
30
|
+
constructor(options: IHttpProxyOptions, connectionPool: ConnectionPool, routeManager?: RouteManager, functionCache?: any, // FunctionCache - using any to avoid circular dependency
|
|
33
31
|
router?: any);
|
|
34
32
|
/**
|
|
35
33
|
* Set the route manager instance
|