@push.rocks/smartproxy 25.5.0 → 25.7.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 +20 -0
- package/dist_rust/rustproxy_linux_amd64 +0 -0
- package/dist_rust/rustproxy_linux_arm64 +0 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- 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/package.json +1 -1
- package/readme.md +47 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/proxies/smart-proxy/models/route-types.ts +1 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-02-16 - 25.7.0 - feat(routes)
|
|
4
|
+
add protocol-based route matching and ensure terminate-and-reencrypt routes HTTP through the full HTTP proxy; update docs and tests
|
|
5
|
+
|
|
6
|
+
- Introduce a new 'protocol' match field for routes (supports 'http' and 'tcp') and preserve it through cloning/merging.
|
|
7
|
+
- Add Rust integration test verifying terminate-and-reencrypt decrypts TLS and routes HTTP traffic via the HTTP proxy (per-request Host/path routing) instead of raw tunneling.
|
|
8
|
+
- Add TypeScript unit tests covering protocol field validation, preservation, interaction with terminate-and-reencrypt, cloning, merging, and matching behavior.
|
|
9
|
+
- Update README with a Protocol-Specific Routing section and clarify terminate-and-reencrypt behavior (HTTP routed via HTTP proxy; non-HTTP uses raw TLS-to-TLS tunnel).
|
|
10
|
+
- Example config: include health check thresholds (unhealthyThreshold and healthyThreshold) in the sample healthCheck settings.
|
|
11
|
+
|
|
12
|
+
## 2026-02-16 - 25.6.0 - feat(rustproxy)
|
|
13
|
+
add protocol-based routing and backend TLS re-encryption support
|
|
14
|
+
|
|
15
|
+
- Introduce optional route_match.protocol ("http" | "tcp") in Rust and TypeScript route types to allow protocol-restricted routing.
|
|
16
|
+
- RouteManager: respect protocol field during matching and treat TLS connections without SNI as not matching domain-restricted routes (except wildcard-only routes).
|
|
17
|
+
- HTTP proxy: add BackendStream abstraction to unify plain TCP and tokio-rustls TLS backend streams, and support connecting to upstreams over TLS (upstream.use_tls) with an InsecureBackendVerifier for internal/self-signed backends.
|
|
18
|
+
- WebSocket and HTTP forwarding updated to use BackendStream so upstream TLS is handled transparently.
|
|
19
|
+
- Passthrough listener: perform post-termination protocol detection for TerminateAndReencrypt; route HTTP flows into HttpProxyService and handle non-HTTP as TLS-to-TLS tunnel.
|
|
20
|
+
- Add tests for protocol matching, TLS/no-SNI behavior, and other routing edge cases.
|
|
21
|
+
- Add rustls and tokio-rustls dependencies (Cargo.toml/Cargo.lock updates).
|
|
22
|
+
|
|
3
23
|
## 2026-02-16 - 25.5.0 - feat(tls)
|
|
4
24
|
add shared TLS acceptor with SNI resolver and session resumption; prefer shared acceptor and fall back to per-connection when routes specify custom TLS versions
|
|
5
25
|
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '25.
|
|
6
|
+
version: '25.7.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=
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91dGUtdHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi90cy9wcm94aWVzL3NtYXJ0LXByb3h5L21vZGVscy9yb3V0ZS10eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHFCQUFxQixDQUFDO0FBc1cvQyxvRUFBb0UifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.7.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
|
@@ -27,7 +27,7 @@ Whether you're building microservices, deploying edge infrastructure, or need a
|
|
|
27
27
|
| 🦀 **Rust-Powered Engine** | All networking handled by a high-performance Rust binary via IPC |
|
|
28
28
|
| 🔀 **Unified Route-Based Config** | Clean match/action patterns for intuitive traffic routing |
|
|
29
29
|
| 🔒 **Automatic SSL/TLS** | Zero-config HTTPS with Let's Encrypt ACME integration |
|
|
30
|
-
| 🎯 **Flexible Matching** | Route by port, domain, path, client IP, TLS version, headers, or custom logic |
|
|
30
|
+
| 🎯 **Flexible Matching** | Route by port, domain, path, protocol, client IP, TLS version, headers, or custom logic |
|
|
31
31
|
| 🚄 **High-Performance** | Choose between user-space or kernel-level (NFTables) forwarding |
|
|
32
32
|
| ⚖️ **Load Balancing** | Round-robin, least-connections, IP-hash with health checks |
|
|
33
33
|
| 🛡️ **Enterprise Security** | IP filtering, rate limiting, basic auth, JWT auth, connection limits |
|
|
@@ -89,7 +89,7 @@ SmartProxy uses a powerful **match/action** pattern that makes routing predictab
|
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Every route consists of:
|
|
92
|
-
- **Match** — What traffic to capture (ports, domains, paths, IPs, headers)
|
|
92
|
+
- **Match** — What traffic to capture (ports, domains, paths, protocol, IPs, headers)
|
|
93
93
|
- **Action** — What to do with it (`forward` or `socket-handler`)
|
|
94
94
|
- **Security** (optional) — IP allow/block lists, rate limits, authentication
|
|
95
95
|
- **Headers** (optional) — Request/response header manipulation with template variables
|
|
@@ -103,7 +103,7 @@ SmartProxy supports three TLS handling modes:
|
|
|
103
103
|
|------|-------------|----------|
|
|
104
104
|
| `passthrough` | Forward encrypted traffic as-is (SNI-based routing) | Backend handles TLS |
|
|
105
105
|
| `terminate` | Decrypt at proxy, forward plain HTTP to backend | Standard reverse proxy |
|
|
106
|
-
| `terminate-and-reencrypt` | Decrypt,
|
|
106
|
+
| `terminate-and-reencrypt` | Decrypt at proxy, re-encrypt to backend. HTTP traffic gets full per-request routing (Host header, path matching) via the HTTP proxy; non-HTTP traffic uses a raw TLS-to-TLS tunnel | Zero-trust / defense-in-depth environments |
|
|
107
107
|
|
|
108
108
|
## 💡 Common Use Cases
|
|
109
109
|
|
|
@@ -135,13 +135,13 @@ const proxy = new SmartProxy({
|
|
|
135
135
|
],
|
|
136
136
|
{
|
|
137
137
|
tls: { mode: 'terminate', certificate: 'auto' },
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
algorithm: 'round-robin',
|
|
139
|
+
healthCheck: {
|
|
140
|
+
path: '/health',
|
|
141
|
+
interval: 30000,
|
|
142
|
+
timeout: 5000,
|
|
143
|
+
unhealthyThreshold: 3,
|
|
144
|
+
healthyThreshold: 2
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
)
|
|
@@ -318,6 +318,42 @@ const proxy = new SmartProxy({
|
|
|
318
318
|
|
|
319
319
|
> **Note:** Routes with dynamic functions (host/port callbacks) are automatically relayed through the TypeScript socket handler server, since JavaScript functions can't be serialized to Rust.
|
|
320
320
|
|
|
321
|
+
### 🔀 Protocol-Specific Routing
|
|
322
|
+
|
|
323
|
+
Restrict routes to specific application-layer protocols. When `protocol` is set, the Rust engine detects the protocol after connection (or after TLS termination) and only matches routes that accept that protocol:
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
// HTTP-only route (rejects raw TCP connections)
|
|
327
|
+
const httpOnlyRoute: IRouteConfig = {
|
|
328
|
+
name: 'http-api',
|
|
329
|
+
match: {
|
|
330
|
+
ports: 443,
|
|
331
|
+
domains: 'api.example.com',
|
|
332
|
+
protocol: 'http', // Only match HTTP/1.1, HTTP/2, and WebSocket upgrades
|
|
333
|
+
},
|
|
334
|
+
action: {
|
|
335
|
+
type: 'forward',
|
|
336
|
+
targets: [{ host: 'api-backend', port: 8080 }],
|
|
337
|
+
tls: { mode: 'terminate', certificate: 'auto' }
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
// Raw TCP route (rejects HTTP traffic)
|
|
342
|
+
const tcpOnlyRoute: IRouteConfig = {
|
|
343
|
+
name: 'database-proxy',
|
|
344
|
+
match: {
|
|
345
|
+
ports: 5432,
|
|
346
|
+
protocol: 'tcp', // Only match non-HTTP TCP streams
|
|
347
|
+
},
|
|
348
|
+
action: {
|
|
349
|
+
type: 'forward',
|
|
350
|
+
targets: [{ host: 'db-server', port: 5432 }]
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
> **Note:** Omitting `protocol` (the default) matches any protocol. For TLS routes, protocol detection happens *after* TLS termination — during the initial SNI-based route match, `protocol` is not yet known and the route is allowed to match. The protocol restriction is enforced after the proxy peeks at the decrypted data.
|
|
356
|
+
|
|
321
357
|
### 🔒 Security Controls
|
|
322
358
|
|
|
323
359
|
Comprehensive per-route security options:
|
|
@@ -549,6 +585,7 @@ interface IRouteMatch {
|
|
|
549
585
|
clientIp?: string[]; // ['10.0.0.0/8', '192.168.*']
|
|
550
586
|
tlsVersion?: string[]; // ['TLSv1.2', 'TLSv1.3']
|
|
551
587
|
headers?: Record<string, string | RegExp>; // Match by HTTP headers
|
|
588
|
+
protocol?: 'http' | 'tcp'; // Match specific protocol ('http' includes h2 + WebSocket upgrades)
|
|
552
589
|
}
|
|
553
590
|
```
|
|
554
591
|
|
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: '25.
|
|
6
|
+
version: '25.7.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
|
}
|
|
@@ -39,6 +39,7 @@ export interface IRouteMatch {
|
|
|
39
39
|
clientIp?: string[]; // Match specific client IPs
|
|
40
40
|
tlsVersion?: string[]; // Match specific TLS versions
|
|
41
41
|
headers?: Record<string, string | RegExp>; // Match specific HTTP headers
|
|
42
|
+
protocol?: 'http' | 'tcp'; // Match specific protocol (http includes h2 + websocket upgrades)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
|