@push.rocks/smartproxy 22.6.0 → 23.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/changelog.md +8 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/index.d.ts +0 -1
- package/dist_ts/index.js +1 -3
- package/dist_ts/proxies/index.d.ts +0 -1
- package/dist_ts/proxies/index.js +1 -3
- package/dist_ts/proxies/smart-proxy/models/route-types.js +1 -1
- package/package.json +1 -1
- package/readme.md +0 -26
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/index.ts +0 -3
- package/ts/proxies/index.ts +0 -3
- package/ts/proxies/smart-proxy/models/route-types.ts +0 -2
- package/dist_ts/proxies/nftables-proxy/index.d.ts +0 -6
- package/dist_ts/proxies/nftables-proxy/index.js +0 -7
- package/dist_ts/proxies/nftables-proxy/models/errors.d.ts +0 -15
- package/dist_ts/proxies/nftables-proxy/models/errors.js +0 -28
- package/dist_ts/proxies/nftables-proxy/models/index.d.ts +0 -5
- package/dist_ts/proxies/nftables-proxy/models/index.js +0 -6
- package/dist_ts/proxies/nftables-proxy/models/interfaces.d.ts +0 -75
- package/dist_ts/proxies/nftables-proxy/models/interfaces.js +0 -5
- package/dist_ts/proxies/nftables-proxy/nftables-proxy.d.ts +0 -124
- package/dist_ts/proxies/nftables-proxy/nftables-proxy.js +0 -1374
- package/dist_ts/proxies/nftables-proxy/utils/index.d.ts +0 -9
- package/dist_ts/proxies/nftables-proxy/utils/index.js +0 -12
- package/dist_ts/proxies/nftables-proxy/utils/nft-command-executor.d.ts +0 -66
- package/dist_ts/proxies/nftables-proxy/utils/nft-command-executor.js +0 -131
- package/dist_ts/proxies/nftables-proxy/utils/nft-port-spec-normalizer.d.ts +0 -39
- package/dist_ts/proxies/nftables-proxy/utils/nft-port-spec-normalizer.js +0 -112
- package/dist_ts/proxies/nftables-proxy/utils/nft-rule-validator.d.ts +0 -59
- package/dist_ts/proxies/nftables-proxy/utils/nft-rule-validator.js +0 -130
- package/ts/proxies/nftables-proxy/index.ts +0 -6
- package/ts/proxies/nftables-proxy/models/errors.ts +0 -30
- package/ts/proxies/nftables-proxy/models/index.ts +0 -5
- package/ts/proxies/nftables-proxy/models/interfaces.ts +0 -94
- package/ts/proxies/nftables-proxy/nftables-proxy.ts +0 -1754
- package/ts/proxies/nftables-proxy/utils/index.ts +0 -38
- package/ts/proxies/nftables-proxy/utils/nft-command-executor.ts +0 -162
- package/ts/proxies/nftables-proxy/utils/nft-port-spec-normalizer.ts +0 -125
- package/ts/proxies/nftables-proxy/utils/nft-rule-validator.ts +0 -156
package/changelog.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-02-09 - 23.0.0 - BREAKING CHANGE(proxies/nftables-proxy)
|
|
4
|
+
remove nftables-proxy implementation, models, and utilities from the repository
|
|
5
|
+
|
|
6
|
+
- Deleted nftables-proxy module files under ts/proxies/nftables-proxy (index, models, utils, command executor, validators, etc.)
|
|
7
|
+
- Removed nftables-proxy exports from ts/index.ts and ts/proxies/index.ts
|
|
8
|
+
- Updated smart-proxy types to drop dependency on nftables proxy models
|
|
9
|
+
- Breaking change: any consumers importing nftables-proxy will no longer find those exports; update imports or install/use the extracted/alternative package if applicable
|
|
10
|
+
|
|
3
11
|
## 2026-02-09 - 22.6.0 - feat(smart-proxy)
|
|
4
12
|
add socket-handler relay, fast-path port-only forwarding, metrics and bridge improvements, and various TS/Rust integration fixes
|
|
5
13
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '
|
|
6
|
+
version: '23.0.0',
|
|
7
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
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHFQQUFxUDtDQUNuUSxDQUFBIn0=
|
package/dist_ts/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SmartProxy main module exports
|
|
3
3
|
*/
|
|
4
|
-
export * from './proxies/nftables-proxy/index.js';
|
|
5
4
|
export { SmartProxy } from './proxies/smart-proxy/index.js';
|
|
6
5
|
export { SharedRouteManager as RouteManager } from './core/routing/route-manager.js';
|
|
7
6
|
export type { ISmartProxyOptions, IConnectionRecord, IRouteConfig, IRouteMatch, IRouteAction, IRouteTls, IRouteContext } from './proxies/smart-proxy/models/index.js';
|
package/dist_ts/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SmartProxy main module exports
|
|
3
3
|
*/
|
|
4
|
-
// NFTables proxy exports
|
|
5
|
-
export * from './proxies/nftables-proxy/index.js';
|
|
6
4
|
// Export SmartProxy elements
|
|
7
5
|
export { SmartProxy } from './proxies/smart-proxy/index.js';
|
|
8
6
|
export { SharedRouteManager as RouteManager } from './core/routing/route-manager.js';
|
|
@@ -17,4 +15,4 @@ export * as tls from './tls/index.js';
|
|
|
17
15
|
export * as routing from './routing/index.js';
|
|
18
16
|
export * as detection from './detection/index.js';
|
|
19
17
|
export * as protocols from './protocols/index.js';
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILDZCQUE2QjtBQUM3QixPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDNUQsT0FBTyxFQUFFLGtCQUFrQixJQUFJLFlBQVksRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBS3JGLGNBQWMsc0NBQXNDLENBQUM7QUFFckQsa0VBQWtFO0FBQ2xFLG9DQUFvQztBQUNwQyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFdEQsMkJBQTJCO0FBQzNCLGNBQWMsK0JBQStCLENBQUM7QUFLOUMsdUNBQXVDO0FBQ3ZDLE9BQU8sS0FBSyxHQUFHLE1BQU0sZ0JBQWdCLENBQUM7QUFDdEMsT0FBTyxLQUFLLE9BQU8sTUFBTSxvQkFBb0IsQ0FBQztBQUM5QyxPQUFPLEtBQUssU0FBUyxNQUFNLHNCQUFzQixDQUFDO0FBQ2xELE9BQU8sS0FBSyxTQUFTLE1BQU0sc0JBQXNCLENBQUMifQ==
|
|
@@ -5,4 +5,3 @@ export { SmartProxy } from './smart-proxy/index.js';
|
|
|
5
5
|
export { SharedRouteManager as SmartProxyRouteManager } from '../core/routing/route-manager.js';
|
|
6
6
|
export * from './smart-proxy/utils/index.js';
|
|
7
7
|
export type { ISmartProxyOptions, IConnectionRecord, IRouteConfig, IRouteMatch, IRouteAction, IRouteTls, IRouteContext } from './smart-proxy/models/index.js';
|
|
8
|
-
export * from './nftables-proxy/index.js';
|
package/dist_ts/proxies/index.js
CHANGED
|
@@ -5,6 +5,4 @@
|
|
|
5
5
|
export { SmartProxy } from './smart-proxy/index.js';
|
|
6
6
|
export { SharedRouteManager as SmartProxyRouteManager } from '../core/routing/route-manager.js';
|
|
7
7
|
export * from './smart-proxy/utils/index.js';
|
|
8
|
-
|
|
9
|
-
export * from './nftables-proxy/index.js';
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9wcm94aWVzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsOERBQThEO0FBQzlELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNwRCxPQUFPLEVBQUUsa0JBQWtCLElBQUksc0JBQXNCLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUNoRyxjQUFjLDhCQUE4QixDQUFDO0FBSTdDLHVDQUF1QztBQUN2QyxjQUFjLDJCQUEyQixDQUFDIn0=
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9wcm94aWVzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsOERBQThEO0FBQzlELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNwRCxPQUFPLEVBQUUsa0JBQWtCLElBQUksc0JBQXNCLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUNoRyxjQUFjLDhCQUE4QixDQUFDIn0=
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as plugins from '../../../plugins.js';
|
|
2
2
|
// Configuration moved to models/interfaces.ts as ISmartProxyOptions
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtdHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L21vZGVscy9yb3V0ZS10eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHFCQUFxQixDQUFDO0FBcVcvQyxvRUFBb0UifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"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.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/readme.md
CHANGED
|
@@ -730,32 +730,6 @@ interface ISmartProxyOptions {
|
|
|
730
730
|
}
|
|
731
731
|
```
|
|
732
732
|
|
|
733
|
-
### NfTablesProxy Class
|
|
734
|
-
|
|
735
|
-
A standalone class for managing nftables NAT rules directly (Linux only, requires root):
|
|
736
|
-
|
|
737
|
-
```typescript
|
|
738
|
-
import { NfTablesProxy } from '@push.rocks/smartproxy';
|
|
739
|
-
|
|
740
|
-
const nftProxy = new NfTablesProxy({
|
|
741
|
-
fromPort: [80, 443],
|
|
742
|
-
toPort: [8080, 8443],
|
|
743
|
-
toHost: 'backend-server',
|
|
744
|
-
protocol: 'tcp',
|
|
745
|
-
preserveSourceIP: true,
|
|
746
|
-
ipv6Support: true,
|
|
747
|
-
useIPSets: true,
|
|
748
|
-
qos: {
|
|
749
|
-
enabled: true,
|
|
750
|
-
maxRate: '1gbps'
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
|
|
754
|
-
await nftProxy.start(); // Apply nftables rules
|
|
755
|
-
const status = await nftProxy.getStatus();
|
|
756
|
-
await nftProxy.stop(); // Remove rules
|
|
757
|
-
```
|
|
758
|
-
|
|
759
733
|
## 🐛 Troubleshooting
|
|
760
734
|
|
|
761
735
|
### Certificate Issues
|
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: '
|
|
6
|
+
version: '23.0.0',
|
|
7
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
|
}
|
package/ts/index.ts
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
* SmartProxy main module exports
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
// NFTables proxy exports
|
|
6
|
-
export * from './proxies/nftables-proxy/index.js';
|
|
7
|
-
|
|
8
5
|
// Export SmartProxy elements
|
|
9
6
|
export { SmartProxy } from './proxies/smart-proxy/index.js';
|
|
10
7
|
export { SharedRouteManager as RouteManager } from './core/routing/route-manager.js';
|
package/ts/proxies/index.ts
CHANGED
|
@@ -8,6 +8,3 @@ export { SharedRouteManager as SmartProxyRouteManager } from '../core/routing/ro
|
|
|
8
8
|
export * from './smart-proxy/utils/index.js';
|
|
9
9
|
// Export smart-proxy models except IAcmeOptions
|
|
10
10
|
export type { ISmartProxyOptions, IConnectionRecord, IRouteConfig, IRouteMatch, IRouteAction, IRouteTls, IRouteContext } from './smart-proxy/models/index.js';
|
|
11
|
-
|
|
12
|
-
// Export NFTables proxy (no conflicts)
|
|
13
|
-
export * from './nftables-proxy/index.js';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as plugins from '../../../plugins.js';
|
|
2
|
-
// Certificate types removed - use local definition
|
|
3
|
-
import type { PortRange } from '../../../proxies/nftables-proxy/models/interfaces.js';
|
|
4
2
|
import type { IRouteContext } from '../../../core/models/route-context.js';
|
|
5
3
|
|
|
6
4
|
// Re-export IRouteContext for convenience
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NfTablesProxy implementation
|
|
3
|
-
*/
|
|
4
|
-
export * from './nftables-proxy.js';
|
|
5
|
-
export * from './models/index.js';
|
|
6
|
-
export * from './utils/index.js';
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi90cy9wcm94aWVzL25mdGFibGVzLXByb3h5L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsY0FBYyxxQkFBcUIsQ0FBQztBQUNwQyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsa0JBQWtCLENBQUMifQ==
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom error classes for better error handling
|
|
3
|
-
*/
|
|
4
|
-
export declare class NftBaseError extends Error {
|
|
5
|
-
constructor(message: string);
|
|
6
|
-
}
|
|
7
|
-
export declare class NftValidationError extends NftBaseError {
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
10
|
-
export declare class NftExecutionError extends NftBaseError {
|
|
11
|
-
constructor(message: string);
|
|
12
|
-
}
|
|
13
|
-
export declare class NftResourceError extends NftBaseError {
|
|
14
|
-
constructor(message: string);
|
|
15
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Custom error classes for better error handling
|
|
3
|
-
*/
|
|
4
|
-
export class NftBaseError extends Error {
|
|
5
|
-
constructor(message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'NftBaseError';
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export class NftValidationError extends NftBaseError {
|
|
11
|
-
constructor(message) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = 'NftValidationError';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export class NftExecutionError extends NftBaseError {
|
|
17
|
-
constructor(message) {
|
|
18
|
-
super(message);
|
|
19
|
-
this.name = 'NftExecutionError';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export class NftResourceError extends NftBaseError {
|
|
23
|
-
constructor(message) {
|
|
24
|
-
super(message);
|
|
25
|
-
this.name = 'NftResourceError';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vdHMvcHJveGllcy9uZnRhYmxlcy1wcm94eS9tb2RlbHMvZXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxPQUFPLFlBQWEsU0FBUSxLQUFLO0lBQ3JDLFlBQVksT0FBZTtRQUN6QixLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsSUFBSSxHQUFHLGNBQWMsQ0FBQztJQUM3QixDQUFDO0NBQ0Y7QUFFRCxNQUFNLE9BQU8sa0JBQW1CLFNBQVEsWUFBWTtJQUNsRCxZQUFZLE9BQWU7UUFDekIsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2YsSUFBSSxDQUFDLElBQUksR0FBRyxvQkFBb0IsQ0FBQztJQUNuQyxDQUFDO0NBQ0Y7QUFFRCxNQUFNLE9BQU8saUJBQWtCLFNBQVEsWUFBWTtJQUNqRCxZQUFZLE9BQWU7UUFDekIsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2YsSUFBSSxDQUFDLElBQUksR0FBRyxtQkFBbUIsQ0FBQztJQUNsQyxDQUFDO0NBQ0Y7QUFFRCxNQUFNLE9BQU8sZ0JBQWlCLFNBQVEsWUFBWTtJQUNoRCxZQUFZLE9BQWU7UUFDekIsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2YsSUFBSSxDQUFDLElBQUksR0FBRyxrQkFBa0IsQ0FBQztJQUNqQyxDQUFDO0NBQ0YifQ==
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Export all models
|
|
3
|
-
*/
|
|
4
|
-
export * from './interfaces.js';
|
|
5
|
-
export * from './errors.js';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL25mdGFibGVzLXByb3h5L21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxhQUFhLENBQUMifQ==
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interfaces for NfTablesProxy
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Represents a port range for forwarding
|
|
6
|
-
*/
|
|
7
|
-
export interface PortRange {
|
|
8
|
-
from: number;
|
|
9
|
-
to: number;
|
|
10
|
-
}
|
|
11
|
-
export type IPortRange = PortRange;
|
|
12
|
-
/**
|
|
13
|
-
* Settings for NfTablesProxy.
|
|
14
|
-
*/
|
|
15
|
-
export interface NfTableProxyOptions {
|
|
16
|
-
fromPort: number | PortRange | Array<number | PortRange>;
|
|
17
|
-
toPort: number | PortRange | Array<number | PortRange>;
|
|
18
|
-
toHost?: string;
|
|
19
|
-
preserveSourceIP?: boolean;
|
|
20
|
-
deleteOnExit?: boolean;
|
|
21
|
-
protocol?: 'tcp' | 'udp' | 'all';
|
|
22
|
-
enableLogging?: boolean;
|
|
23
|
-
ipv6Support?: boolean;
|
|
24
|
-
logFormat?: 'plain' | 'json';
|
|
25
|
-
ipAllowList?: string[];
|
|
26
|
-
ipBlockList?: string[];
|
|
27
|
-
useIPSets?: boolean;
|
|
28
|
-
forceCleanSlate?: boolean;
|
|
29
|
-
tableName?: string;
|
|
30
|
-
maxRetries?: number;
|
|
31
|
-
retryDelayMs?: number;
|
|
32
|
-
useAdvancedNAT?: boolean;
|
|
33
|
-
qos?: {
|
|
34
|
-
enabled: boolean;
|
|
35
|
-
maxRate?: string;
|
|
36
|
-
priority?: number;
|
|
37
|
-
markConnections?: boolean;
|
|
38
|
-
};
|
|
39
|
-
netProxyIntegration?: {
|
|
40
|
-
enabled: boolean;
|
|
41
|
-
redirectLocalhost?: boolean;
|
|
42
|
-
sslTerminationPort?: number;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export type INfTableProxySettings = NfTableProxyOptions;
|
|
46
|
-
/**
|
|
47
|
-
* Interface for status reporting
|
|
48
|
-
*/
|
|
49
|
-
export interface NfTablesStatus {
|
|
50
|
-
active: boolean;
|
|
51
|
-
ruleCount: {
|
|
52
|
-
total: number;
|
|
53
|
-
added: number;
|
|
54
|
-
verified: number;
|
|
55
|
-
};
|
|
56
|
-
tablesConfigured: {
|
|
57
|
-
family: string;
|
|
58
|
-
tableName: string;
|
|
59
|
-
}[];
|
|
60
|
-
metrics: {
|
|
61
|
-
forwardedConnections?: number;
|
|
62
|
-
activeConnections?: number;
|
|
63
|
-
bytesForwarded?: {
|
|
64
|
-
sent: number;
|
|
65
|
-
received: number;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
qosEnabled?: boolean;
|
|
69
|
-
ipSetsConfigured?: {
|
|
70
|
-
name: string;
|
|
71
|
-
elementCount: number;
|
|
72
|
-
type: string;
|
|
73
|
-
}[];
|
|
74
|
-
}
|
|
75
|
-
export type INfTablesStatus = NfTablesStatus;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interfaces for NfTablesProxy
|
|
3
|
-
*/
|
|
4
|
-
export {};
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3RzL3Byb3hpZXMvbmZ0YWJsZXMtcHJveHkvbW9kZWxzL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUcifQ==
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { NfTableProxyOptions, NfTablesStatus } from './models/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* NfTablesProxy sets up nftables NAT rules to forward TCP traffic.
|
|
4
|
-
* Enhanced with multi-port support, IPv6, connection tracking, metrics,
|
|
5
|
-
* and more advanced features.
|
|
6
|
-
*/
|
|
7
|
-
export declare class NfTablesProxy {
|
|
8
|
-
settings: NfTableProxyOptions;
|
|
9
|
-
private rules;
|
|
10
|
-
private ipSets;
|
|
11
|
-
private ruleTag;
|
|
12
|
-
private tableName;
|
|
13
|
-
private tempFilePath;
|
|
14
|
-
private executor;
|
|
15
|
-
private static NFT_CMD;
|
|
16
|
-
constructor(settings: NfTableProxyOptions);
|
|
17
|
-
/**
|
|
18
|
-
* Checks if nftables is available and the required modules are loaded
|
|
19
|
-
*/
|
|
20
|
-
private checkNftablesAvailability;
|
|
21
|
-
/**
|
|
22
|
-
* Creates the necessary tables and chains
|
|
23
|
-
*/
|
|
24
|
-
private setupTablesAndChains;
|
|
25
|
-
/**
|
|
26
|
-
* Creates IP sets for efficient filtering of large IP lists
|
|
27
|
-
*/
|
|
28
|
-
private createIPSet;
|
|
29
|
-
/**
|
|
30
|
-
* Adds source IP filtering rules, potentially using IP sets for efficiency
|
|
31
|
-
*/
|
|
32
|
-
private addSourceIPFilters;
|
|
33
|
-
/**
|
|
34
|
-
* Gets a comma-separated list of all ports from a port specification
|
|
35
|
-
*/
|
|
36
|
-
private getAllPorts;
|
|
37
|
-
/**
|
|
38
|
-
* Configures advanced NAT with connection tracking
|
|
39
|
-
*/
|
|
40
|
-
private setupAdvancedNAT;
|
|
41
|
-
/**
|
|
42
|
-
* Adds port forwarding rules
|
|
43
|
-
*/
|
|
44
|
-
private addPortForwardingRules;
|
|
45
|
-
/**
|
|
46
|
-
* Adds port forwarding rules for the case where one toPortRange maps to multiple fromPortRanges
|
|
47
|
-
*/
|
|
48
|
-
private addPortMappings;
|
|
49
|
-
/**
|
|
50
|
-
* Adds port forwarding rules for pairs of fromPortRanges and toPortRanges
|
|
51
|
-
*/
|
|
52
|
-
private addPortPairMappings;
|
|
53
|
-
/**
|
|
54
|
-
* Setup quality of service rules
|
|
55
|
-
*/
|
|
56
|
-
private addTrafficShaping;
|
|
57
|
-
/**
|
|
58
|
-
* Setup NetworkProxy integration rules
|
|
59
|
-
*/
|
|
60
|
-
private setupNetworkProxyIntegration;
|
|
61
|
-
/**
|
|
62
|
-
* Verify that a rule was successfully applied
|
|
63
|
-
*/
|
|
64
|
-
private verifyRuleApplication;
|
|
65
|
-
/**
|
|
66
|
-
* Rolls back rules in case of error during setup
|
|
67
|
-
*/
|
|
68
|
-
private rollbackRules;
|
|
69
|
-
/**
|
|
70
|
-
* Checks if nftables table exists
|
|
71
|
-
*/
|
|
72
|
-
private tableExists;
|
|
73
|
-
/**
|
|
74
|
-
* Get system metrics like connection counts
|
|
75
|
-
*/
|
|
76
|
-
private getSystemMetrics;
|
|
77
|
-
/**
|
|
78
|
-
* Get status of IP sets
|
|
79
|
-
*/
|
|
80
|
-
private getIPSetStatus;
|
|
81
|
-
/**
|
|
82
|
-
* Get detailed status about the current state of the proxy
|
|
83
|
-
*/
|
|
84
|
-
getStatus(): Promise<NfTablesStatus>;
|
|
85
|
-
/**
|
|
86
|
-
* Performs a dry run to see what commands would be executed without actually applying them
|
|
87
|
-
*/
|
|
88
|
-
dryRun(): Promise<string[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Starts the proxy by setting up all nftables rules
|
|
91
|
-
*/
|
|
92
|
-
start(): Promise<void>;
|
|
93
|
-
/**
|
|
94
|
-
* Stops the proxy by removing all added rules
|
|
95
|
-
*/
|
|
96
|
-
stop(): Promise<void>;
|
|
97
|
-
/**
|
|
98
|
-
* Synchronous version of stop, for use in exit handlers only.
|
|
99
|
-
* Uses single-attempt commands without retry (process is exiting anyway).
|
|
100
|
-
*/
|
|
101
|
-
stopSync(): void;
|
|
102
|
-
/**
|
|
103
|
-
* Cleans up empty tables
|
|
104
|
-
*/
|
|
105
|
-
private cleanupEmptyTables;
|
|
106
|
-
/**
|
|
107
|
-
* Synchronous version of cleanupEmptyTables (for exit handlers only)
|
|
108
|
-
*/
|
|
109
|
-
private cleanupEmptyTablesSync;
|
|
110
|
-
/**
|
|
111
|
-
* Removes all nftables rules created by this module
|
|
112
|
-
*/
|
|
113
|
-
static cleanSlate(): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Synchronous version of cleanSlate
|
|
116
|
-
* @deprecated This method blocks the event loop and should be avoided. Use cleanSlate() instead.
|
|
117
|
-
* WARNING: This method uses execSync which blocks the entire Node.js event loop!
|
|
118
|
-
*/
|
|
119
|
-
static cleanSlateSync(): void;
|
|
120
|
-
/**
|
|
121
|
-
* Improved logging with structured output
|
|
122
|
-
*/
|
|
123
|
-
private log;
|
|
124
|
-
}
|