@push.rocks/smartproxy 3.28.6 → 3.29.1
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/classes.iptablesproxy.d.ts +79 -7
- package/dist_ts/classes.iptablesproxy.js +662 -67
- package/dist_ts/classes.networkproxy.d.ts +46 -1
- package/dist_ts/classes.networkproxy.js +347 -8
- package/dist_ts/classes.portproxy.d.ts +36 -0
- package/dist_ts/classes.portproxy.js +464 -365
- package/package.json +2 -2
- package/readme.md +80 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.iptablesproxy.ts +786 -68
- package/ts/classes.networkproxy.ts +417 -7
- package/ts/classes.portproxy.ts +652 -485
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
|
+
import { NetworkProxy } from './classes.networkproxy.js';
|
|
2
3
|
/** Domain configuration with per-domain allowed port ranges */
|
|
3
4
|
export interface IDomainConfig {
|
|
4
5
|
domains: string[];
|
|
@@ -10,6 +11,8 @@ export interface IDomainConfig {
|
|
|
10
11
|
to: number;
|
|
11
12
|
}>;
|
|
12
13
|
connectionTimeout?: number;
|
|
14
|
+
useNetworkProxy?: boolean;
|
|
15
|
+
networkProxyIndex?: number;
|
|
13
16
|
}
|
|
14
17
|
/** Port proxy settings including global allowed port ranges */
|
|
15
18
|
export interface IPortProxySettings extends plugins.tls.TlsOptions {
|
|
@@ -46,6 +49,7 @@ export interface IPortProxySettings extends plugins.tls.TlsOptions {
|
|
|
46
49
|
keepAliveTreatment?: 'standard' | 'extended' | 'immortal';
|
|
47
50
|
keepAliveInactivityMultiplier?: number;
|
|
48
51
|
extendedKeepAliveLifetime?: number;
|
|
52
|
+
networkProxies?: NetworkProxy[];
|
|
49
53
|
}
|
|
50
54
|
export declare class PortProxy {
|
|
51
55
|
private netServers;
|
|
@@ -57,7 +61,23 @@ export declare class PortProxy {
|
|
|
57
61
|
private terminationStats;
|
|
58
62
|
private connectionsByIP;
|
|
59
63
|
private connectionRateByIP;
|
|
64
|
+
private networkProxies;
|
|
60
65
|
constructor(settingsArg: IPortProxySettings);
|
|
66
|
+
/**
|
|
67
|
+
* Forwards a TLS connection to a NetworkProxy for handling
|
|
68
|
+
* @param connectionId - Unique connection identifier
|
|
69
|
+
* @param socket - The incoming client socket
|
|
70
|
+
* @param record - The connection record
|
|
71
|
+
* @param domainConfig - The domain configuration
|
|
72
|
+
* @param initialData - Initial data chunk (TLS ClientHello)
|
|
73
|
+
* @param serverName - SNI hostname (if available)
|
|
74
|
+
*/
|
|
75
|
+
private forwardToNetworkProxy;
|
|
76
|
+
/**
|
|
77
|
+
* Sets up a direct connection to the target (original behavior)
|
|
78
|
+
* This is used when NetworkProxy isn't configured or as a fallback
|
|
79
|
+
*/
|
|
80
|
+
private setupDirectConnection;
|
|
61
81
|
/**
|
|
62
82
|
* Get connections count by IP
|
|
63
83
|
*/
|
|
@@ -97,10 +117,26 @@ export declare class PortProxy {
|
|
|
97
117
|
* Initiates cleanup once for a connection
|
|
98
118
|
*/
|
|
99
119
|
private initiateCleanupOnce;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a generic error handler for incoming or outgoing sockets
|
|
122
|
+
*/
|
|
123
|
+
private handleError;
|
|
124
|
+
/**
|
|
125
|
+
* Creates a generic close handler for incoming or outgoing sockets
|
|
126
|
+
*/
|
|
127
|
+
private handleClose;
|
|
100
128
|
/**
|
|
101
129
|
* Main method to start the proxy
|
|
102
130
|
*/
|
|
103
131
|
start(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Add or replace NetworkProxy instances
|
|
134
|
+
*/
|
|
135
|
+
setNetworkProxies(networkProxies: NetworkProxy[]): void;
|
|
136
|
+
/**
|
|
137
|
+
* Get a list of configured NetworkProxy instances
|
|
138
|
+
*/
|
|
139
|
+
getNetworkProxies(): NetworkProxy[];
|
|
104
140
|
/**
|
|
105
141
|
* Gracefully shut down the proxy
|
|
106
142
|
*/
|