@push.rocks/smartproxy 3.29.0 → 3.29.2
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/package.json +1 -1
- package/readme.md +80 -10
- package/ts/00_commitinfo_data.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '3.29.
|
|
6
|
+
version: '3.29.2',
|
|
7
7
|
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, and dynamic routing with authentication options.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLDRMQUE0TDtDQUMxTSxDQUFBIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.2",
|
|
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, and dynamic routing with authentication options.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/readme.md
CHANGED
|
@@ -320,8 +320,8 @@ portProxy.start();
|
|
|
320
320
|
```typescript
|
|
321
321
|
import { IPTablesProxy } from '@push.rocks/smartproxy';
|
|
322
322
|
|
|
323
|
-
//
|
|
324
|
-
const
|
|
323
|
+
// Basic usage - forward single port
|
|
324
|
+
const basicProxy = new IPTablesProxy({
|
|
325
325
|
fromPort: 80,
|
|
326
326
|
toPort: 8080,
|
|
327
327
|
toHost: 'localhost',
|
|
@@ -329,7 +329,38 @@ const iptables = new IPTablesProxy({
|
|
|
329
329
|
deleteOnExit: true // Automatically clean up rules on process exit
|
|
330
330
|
});
|
|
331
331
|
|
|
332
|
-
|
|
332
|
+
// Forward port ranges
|
|
333
|
+
const rangeProxy = new IPTablesProxy({
|
|
334
|
+
fromPort: { from: 3000, to: 3010 }, // Forward ports 3000-3010
|
|
335
|
+
toPort: { from: 8000, to: 8010 }, // To ports 8000-8010
|
|
336
|
+
protocol: 'tcp', // TCP protocol (default)
|
|
337
|
+
ipv6Support: true, // Enable IPv6 support
|
|
338
|
+
enableLogging: true // Enable detailed logging
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// Multiple port specifications with IP filtering
|
|
342
|
+
const advancedProxy = new IPTablesProxy({
|
|
343
|
+
fromPort: [80, 443, { from: 8000, to: 8010 }], // Multiple ports/ranges
|
|
344
|
+
toPort: [8080, 8443, { from: 18000, to: 18010 }],
|
|
345
|
+
allowedSourceIPs: ['10.0.0.0/8', '192.168.1.0/24'], // Only allow these IPs
|
|
346
|
+
bannedSourceIPs: ['192.168.1.100'], // Explicitly block these IPs
|
|
347
|
+
addJumpRule: true, // Use custom chain for better management
|
|
348
|
+
checkExistingRules: true // Check for duplicate rules
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// NetworkProxy integration for SSL termination
|
|
352
|
+
const sslProxy = new IPTablesProxy({
|
|
353
|
+
fromPort: 443,
|
|
354
|
+
toPort: 8443,
|
|
355
|
+
netProxyIntegration: {
|
|
356
|
+
enabled: true,
|
|
357
|
+
redirectLocalhost: true, // Redirect localhost traffic to NetworkProxy
|
|
358
|
+
sslTerminationPort: 8443 // Port where NetworkProxy handles SSL
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
// Start any of the proxies
|
|
363
|
+
await basicProxy.start();
|
|
333
364
|
```
|
|
334
365
|
|
|
335
366
|
### Automatic HTTPS Certificate Management
|
|
@@ -383,13 +414,30 @@ acmeHandler.addDomain('api.example.com');
|
|
|
383
414
|
|
|
384
415
|
### IPTablesProxy Settings
|
|
385
416
|
|
|
386
|
-
| Option
|
|
387
|
-
|
|
388
|
-
| `fromPort`
|
|
389
|
-
| `toPort`
|
|
390
|
-
| `toHost`
|
|
391
|
-
| `preserveSourceIP
|
|
392
|
-
| `deleteOnExit`
|
|
417
|
+
| Option | Description | Default |
|
|
418
|
+
|-----------------------|---------------------------------------------------|-------------|
|
|
419
|
+
| `fromPort` | Source port(s) or range(s) to forward from | - |
|
|
420
|
+
| `toPort` | Destination port(s) or range(s) to forward to | - |
|
|
421
|
+
| `toHost` | Destination host to forward to | 'localhost' |
|
|
422
|
+
| `preserveSourceIP` | Preserve the original client IP | false |
|
|
423
|
+
| `deleteOnExit` | Remove iptables rules when process exits | false |
|
|
424
|
+
| `protocol` | Protocol to forward ('tcp', 'udp', or 'all') | 'tcp' |
|
|
425
|
+
| `enableLogging` | Enable detailed logging | false |
|
|
426
|
+
| `ipv6Support` | Enable IPv6 support with ip6tables | false |
|
|
427
|
+
| `allowedSourceIPs` | Array of IP addresses/CIDR allowed to connect | - |
|
|
428
|
+
| `bannedSourceIPs` | Array of IP addresses/CIDR blocked from connecting | - |
|
|
429
|
+
| `forceCleanSlate` | Clear all IPTablesProxy rules before starting | false |
|
|
430
|
+
| `addJumpRule` | Add a custom chain for cleaner rule management | false |
|
|
431
|
+
| `checkExistingRules` | Check if rules already exist before adding | true |
|
|
432
|
+
| `netProxyIntegration` | NetworkProxy integration options (object) | - |
|
|
433
|
+
|
|
434
|
+
#### IPTablesProxy NetworkProxy Integration Options
|
|
435
|
+
|
|
436
|
+
| Option | Description | Default |
|
|
437
|
+
|----------------------|---------------------------------------------------|---------|
|
|
438
|
+
| `enabled` | Enable NetworkProxy integration | false |
|
|
439
|
+
| `redirectLocalhost` | Redirect localhost traffic to NetworkProxy | false |
|
|
440
|
+
| `sslTerminationPort` | Port where NetworkProxy handles SSL termination | - |
|
|
393
441
|
|
|
394
442
|
## Advanced Features
|
|
395
443
|
|
|
@@ -442,6 +490,18 @@ The `PortProxy` class can inspect the SNI (Server Name Indication) field in TLS
|
|
|
442
490
|
- Domain-specific allowed IP ranges
|
|
443
491
|
- Protection against SNI renegotiation attacks
|
|
444
492
|
|
|
493
|
+
### Enhanced IPTables Management
|
|
494
|
+
|
|
495
|
+
The improved `IPTablesProxy` class offers advanced capabilities:
|
|
496
|
+
|
|
497
|
+
- Support for multiple port ranges and individual ports
|
|
498
|
+
- IPv6 support with ip6tables
|
|
499
|
+
- Source IP filtering with allow/block lists
|
|
500
|
+
- Custom chain creation for better rule organization
|
|
501
|
+
- NetworkProxy integration for SSL termination
|
|
502
|
+
- Automatic rule existence checking to prevent duplicates
|
|
503
|
+
- Comprehensive cleanup on shutdown
|
|
504
|
+
|
|
445
505
|
## Troubleshooting
|
|
446
506
|
|
|
447
507
|
### Browser Certificate Errors
|
|
@@ -475,6 +535,16 @@ For improved connection stability in high-traffic environments:
|
|
|
475
535
|
4. **Monitor Connection Statistics**: Enable detailed logging to track termination reasons
|
|
476
536
|
5. **Fine-tune Inactivity Checks**: Adjust `inactivityCheckInterval` based on your traffic patterns
|
|
477
537
|
|
|
538
|
+
### IPTables Troubleshooting
|
|
539
|
+
|
|
540
|
+
If you're experiencing issues with IPTablesProxy:
|
|
541
|
+
|
|
542
|
+
1. **Enable Detailed Logging**: Set `enableLogging: true` to see all rule operations
|
|
543
|
+
2. **Force Clean Slate**: Use `forceCleanSlate: true` to remove any lingering rules
|
|
544
|
+
3. **Use Custom Chains**: Enable `addJumpRule: true` for cleaner rule management
|
|
545
|
+
4. **Check Permissions**: Ensure your process has sufficient permissions to modify iptables
|
|
546
|
+
5. **Verify IPv6 Support**: If using `ipv6Support: true`, ensure ip6tables is available
|
|
547
|
+
|
|
478
548
|
## License and Legal Information
|
|
479
549
|
|
|
480
550
|
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
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: '3.29.
|
|
6
|
+
version: '3.29.2',
|
|
7
7
|
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, and dynamic routing with authentication options.'
|
|
8
8
|
}
|