@serve.zone/dcrouter 11.6.0 → 11.7.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.
@@ -43149,4 +43149,4 @@ ibantools/jsnext/ibantools.js:
43149
43149
  * @preferred
43150
43150
  *)
43151
43151
  */
43152
- //# sourceMappingURL=bundle-1773947214333.js.map
43152
+ //# sourceMappingURL=bundle-1773953065243.js.map
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/dcrouter',
6
- version: '11.6.0',
6
+ version: '11.7.1',
7
7
  description: 'A multifaceted routing service handling mail and SMS delivery functions.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLDBFQUEwRTtDQUN4RixDQUFBIn0=
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/dcrouter',
6
- version: '11.6.0',
6
+ version: '11.7.1',
7
7
  description: 'A multifaceted routing service handling mail and SMS delivery functions.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfd2ViLzAwX2NvbW1pdGluZm9fZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRztJQUN4QixJQUFJLEVBQUUsc0JBQXNCO0lBQzVCLE9BQU8sRUFBRSxRQUFRO0lBQ2pCLFdBQVcsRUFBRSwwRUFBMEU7Q0FDeEYsQ0FBQSJ9
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@serve.zone/dcrouter",
3
3
  "private": false,
4
- "version": "11.6.0",
4
+ "version": "11.7.1",
5
5
  "description": "A multifaceted routing service handling mail and SMS delivery functions.",
6
6
  "type": "module",
7
7
  "exports": {
@@ -53,7 +53,7 @@
53
53
  "@push.rocks/smartnetwork": "^4.4.0",
54
54
  "@push.rocks/smartpath": "^6.0.0",
55
55
  "@push.rocks/smartpromise": "^4.2.3",
56
- "@push.rocks/smartproxy": "^25.15.0",
56
+ "@push.rocks/smartproxy": "^25.16.0",
57
57
  "@push.rocks/smartradius": "^1.1.1",
58
58
  "@push.rocks/smartrequest": "^5.0.1",
59
59
  "@push.rocks/smartrx": "^3.0.10",
package/readme.md CHANGED
@@ -18,6 +18,7 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
18
18
  - [Architecture](#architecture)
19
19
  - [Configuration Reference](#configuration-reference)
20
20
  - [HTTP/HTTPS & TCP/SNI Routing](#httphttps--tcpsni-routing)
21
+ - [HTTP/3 (QUIC) Support](#http3-quic-support)
21
22
  - [Email System](#email-system)
22
23
  - [DNS Server](#dns-server)
23
24
  - [RADIUS Server](#radius-server)
@@ -37,6 +38,7 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
37
38
 
38
39
  ### 🌐 Universal Traffic Router
39
40
  - **HTTP/HTTPS routing** with domain matching, path-based forwarding, and automatic TLS
41
+ - **HTTP/3 (QUIC) enabled by default** — qualifying HTTPS routes automatically get QUIC/H3 support with zero configuration
40
42
  - **TCP/SNI proxy** for any protocol with TLS termination or passthrough
41
43
  - **DNS server** (Rust-powered via [SmartDNS](https://code.foss.global/push.rocks/smartdns)) with authoritative zones, dynamic record management, and DNS-over-HTTPS
42
44
  - **Multi-protocol support** on the same infrastructure via [SmartProxy](https://code.foss.global/push.rocks/smartproxy)
@@ -425,6 +427,27 @@ interface IDcRouterOptions {
425
427
  };
426
428
  };
427
429
 
430
+ // ── HTTP/3 (QUIC) ────────────────────────────────────────────
431
+ /** HTTP/3 config — enabled by default on qualifying HTTPS routes */
432
+ http3?: {
433
+ enabled?: boolean; // default: true
434
+ quicSettings?: {
435
+ maxIdleTimeout?: number; // default: 30000ms
436
+ maxConcurrentBidiStreams?: number; // default: 100
437
+ maxConcurrentUniStreams?: number; // default: 100
438
+ initialCongestionWindow?: number;
439
+ };
440
+ altSvc?: {
441
+ port?: number; // default: listening port
442
+ maxAge?: number; // default: 86400s
443
+ };
444
+ udpSettings?: {
445
+ sessionTimeout?: number; // default: 60000ms
446
+ maxSessionsPerIP?: number; // default: 1000
447
+ maxDatagramSize?: number; // default: 65535
448
+ };
449
+ };
450
+
428
451
  // ── OpsServer ────────────────────────────────────────────────
429
452
  /** Port for the OpsServer web dashboard (default: 3000) */
430
453
  opsServerPort?: number;
@@ -516,6 +539,102 @@ DcRouter uses [SmartProxy](https://code.foss.global/push.rocks/smartproxy) for a
516
539
  }
517
540
  ```
518
541
 
542
+ ## HTTP/3 (QUIC) Support
543
+
544
+ DcRouter ships with **HTTP/3 enabled by default** 🚀. All qualifying HTTPS routes on port 443 are automatically augmented with QUIC/H3 configuration — no extra setup needed. Under the hood, SmartProxy's native HTTP/3 support (via `IRouteQuic`) handles QUIC transport, Alt-Svc advertisement, and HTTP/3 negotiation.
545
+
546
+ ### How It Works
547
+
548
+ When DcRouter assembles routes in `setupSmartProxy()`, it automatically augments qualifying routes with:
549
+ - `match.transport: 'all'` — listen on both TCP (HTTP/1.1 + HTTP/2) and UDP (QUIC/HTTP/3) on the same port
550
+ - `action.udp.quic` — QUIC configuration with `enableHttp3: true` and `altSvcMaxAge: 86400`
551
+
552
+ Browsers that support HTTP/3 will discover it via the `Alt-Svc` header on initial TCP responses, then upgrade to QUIC for subsequent requests.
553
+
554
+ ### What Gets Augmented
555
+
556
+ A route qualifies for HTTP/3 augmentation when **all** of these are true:
557
+ - Port includes **443** (single number, array, or range)
558
+ - Action type is **`forward`** (not `socket-handler`)
559
+ - **TLS is enabled** (passthrough, terminate, or terminate-and-reencrypt)
560
+ - Route is **not** an email route (ports 25/587/465)
561
+ - Route doesn't already have `transport: 'all'` or existing `udp.quic` config
562
+
563
+ ### Zero-Config (Default Behavior)
564
+
565
+ ```typescript
566
+ // HTTP/3 is ON by default — this route automatically gets QUIC/H3:
567
+ const router = new DcRouter({
568
+ smartProxyConfig: {
569
+ routes: [{
570
+ name: 'web-app',
571
+ match: { domains: ['example.com'], ports: [443] },
572
+ action: {
573
+ type: 'forward',
574
+ targets: [{ host: '192.168.1.10', port: 8080 }],
575
+ tls: { mode: 'terminate', certificate: 'auto' }
576
+ }
577
+ }]
578
+ }
579
+ });
580
+ ```
581
+
582
+ ### Per-Route Opt-Out
583
+
584
+ Disable HTTP/3 on a specific route using `action.options.http3`:
585
+
586
+ ```typescript
587
+ {
588
+ name: 'legacy-app',
589
+ match: { domains: ['legacy.example.com'], ports: [443] },
590
+ action: {
591
+ type: 'forward',
592
+ targets: [{ host: '192.168.1.50', port: 8080 }],
593
+ tls: { mode: 'terminate', certificate: 'auto' },
594
+ options: { http3: false } // ← This route stays TCP-only
595
+ }
596
+ }
597
+ ```
598
+
599
+ ### Global Opt-Out
600
+
601
+ Disable HTTP/3 across all routes:
602
+
603
+ ```typescript
604
+ const router = new DcRouter({
605
+ http3: { enabled: false },
606
+ smartProxyConfig: { routes: [/* ... */] }
607
+ });
608
+ ```
609
+
610
+ ### Custom QUIC Settings
611
+
612
+ Fine-tune QUIC parameters globally:
613
+
614
+ ```typescript
615
+ const router = new DcRouter({
616
+ http3: {
617
+ quicSettings: {
618
+ maxIdleTimeout: 60000, // 60s idle timeout
619
+ maxConcurrentBidiStreams: 200, // More parallel streams
620
+ maxConcurrentUniStreams: 50,
621
+ },
622
+ altSvc: {
623
+ maxAge: 3600, // 1 hour Alt-Svc cache
624
+ },
625
+ udpSettings: {
626
+ sessionTimeout: 120000, // 2 min UDP session timeout
627
+ maxSessionsPerIP: 500,
628
+ }
629
+ },
630
+ smartProxyConfig: { routes: [/* ... */] }
631
+ });
632
+ ```
633
+
634
+ ### Programmatic Routes
635
+
636
+ Routes added at runtime via the Route Management API also get HTTP/3 augmentation automatically — the `RouteConfigManager` applies the same augmentation logic when merging programmatic routes.
637
+
519
638
  ## Email System
520
639
 
521
640
  The email system is powered by [`@push.rocks/smartmta`](https://code.foss.global/push.rocks/smartmta), a TypeScript + Rust hybrid MTA. DcRouter configures and orchestrates smartmta's **UnifiedEmailServer**, which handles SMTP sessions, route matching, delivery queuing, DKIM signing, and all email processing.
@@ -1221,7 +1340,7 @@ const router = new DcRouter(options: IDcRouterOptions);
1221
1340
 
1222
1341
  ### Re-exported Types
1223
1342
 
1224
- DcRouter re-exports key types from smartmta for convenience:
1343
+ DcRouter re-exports key types for convenience:
1225
1344
 
1226
1345
  ```typescript
1227
1346
  import {
@@ -1231,6 +1350,7 @@ import {
1231
1350
  type IUnifiedEmailServerOptions,
1232
1351
  type IEmailRoute,
1233
1352
  type IEmailDomainConfig,
1353
+ type IHttp3Config,
1234
1354
  } from '@serve.zone/dcrouter';
1235
1355
  ```
1236
1356
 
@@ -1277,9 +1397,10 @@ tstest test/test.opsserver-api.ts --verbose --timeout 60
1277
1397
  | `test.dns-server-config.ts` | DNS record parsing, grouping, extraction | 5 |
1278
1398
  | `test.dns-socket-handler.ts` | DNS socket handler and route generation | 6 |
1279
1399
  | `test.errors.ts` | Error classes, handler, retry utilities | 5 |
1400
+ | `test.http3-augmentation.ts` | HTTP/3 route augmentation, qualification, opt-in/out, QUIC settings | 20 |
1280
1401
  | `test.ipreputationchecker.ts` | IP reputation, DNSBL, caching, risk classification | 10 |
1281
1402
  | `test.jwt-auth.ts` | JWT login, verification, logout, invalid credentials | 8 |
1282
- | `test.opsserver-api.ts` | Health, statistics, configuration, log APIs | 6 |
1403
+ | `test.opsserver-api.ts` | Health, statistics, configuration, log APIs | 8 |
1283
1404
  | `test.protected-endpoint.ts` | Admin auth, identity verification, public endpoints | 8 |
1284
1405
  | `test.storagemanager.ts` | Memory, filesystem, custom backends, concurrency | 8 |
1285
1406
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/dcrouter',
6
- version: '11.6.0',
6
+ version: '11.7.1',
7
7
  description: 'A multifaceted routing service handling mail and SMS delivery functions.'
8
8
  }
package/ts/readme.md CHANGED
@@ -60,6 +60,9 @@ ts/
60
60
  │ └── documents/ # Cached document models
61
61
  ├── config/ # Configuration utilities
62
62
  ├── errors/ # Error classes and retry logic
63
+ ├── http3/ # HTTP/3 (QUIC) route augmentation
64
+ │ ├── index.ts # Barrel export
65
+ │ └── http3-route-augmentation.ts # Pure utility: augmentRoutesWithHttp3(), IHttp3Config
63
66
  ├── monitoring/ # MetricsManager (SmartMetrics integration)
64
67
  ├── opsserver/ # OpsServer dashboard + API handlers
65
68
  │ ├── classes.opsserver.ts # HTTP server + TypedRouter setup
@@ -99,6 +102,9 @@ export { RadiusServer, IRadiusServerConfig } from './radius/index.js';
99
102
 
100
103
  // Remote Ingress
101
104
  export { RemoteIngressManager, TunnelManager } from './remoteingress/index.js';
105
+
106
+ // HTTP/3
107
+ export type { IHttp3Config } from './http3/index.js';
102
108
  ```
103
109
 
104
110
  ## Key Classes
@@ -115,6 +121,7 @@ The central orchestrator. Accepts `IDcRouterOptions` and manages the lifecycle o
115
121
  | `radiusConfig` | RadiusServer (auth + accounting) | `@push.rocks/smartradius` |
116
122
  | `remoteIngressConfig` | RemoteIngressManager + TunnelManager | `@serve.zone/remoteingress` |
117
123
  | `tls` + `dnsChallenge` | SmartAcme (ACME cert provisioning) | `@push.rocks/smartacme` |
124
+ | `http3` | HTTP/3 route augmentation (enabled by default) | built-in |
118
125
  | `cacheConfig` | CacheDb (embedded MongoDB) | `@push.rocks/smartdata` |
119
126
  | *(always)* | OpsServer (dashboard + API) | `@api.global/typedserver` |
120
127
  | *(always)* | MetricsManager | `@push.rocks/smartmetrics` |
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/dcrouter',
6
- version: '11.6.0',
6
+ version: '11.7.1',
7
7
  description: 'A multifaceted routing service handling mail and SMS delivery functions.'
8
8
  }