@serve.zone/remoteingress 4.14.1 → 4.14.3

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.
@@ -11,26 +11,26 @@
11
11
  "githost": "code.foss.global",
12
12
  "gitscope": "serve.zone",
13
13
  "gitrepo": "remoteingress",
14
- "description": "Provides a service for creating private tunnels and reaching private clusters from the outside, facilitating secure remote access as part of the @serve.zone stack.",
14
+ "description": "Edge ingress tunnel for DcRouter - tunnels TCP and UDP traffic from the network edge to SmartProxy over TLS or QUIC, preserving client IP via PROXY protocol.",
15
15
  "npmPackagename": "@serve.zone/remoteingress",
16
16
  "license": "MIT",
17
17
  "projectDomain": "serve.zone",
18
18
  "keywords": [
19
19
  "remote access",
20
- "private tunnels",
21
- "network security",
22
- "TLS encryption",
23
- "connector",
20
+ "ingress tunnel",
21
+ "network edge",
22
+ "PROXY protocol",
23
+ "multiplexed tunnel",
24
+ "TCP proxy",
25
+ "TLS tunnel",
26
+ "QUIC transport",
27
+ "UDP tunneling",
24
28
  "serve.zone stack",
25
- "private clusters access",
26
- "public access management",
27
- "TypeScript application",
28
- "node.js package",
29
- "secure communications",
30
- "TLS/SSL certificates",
31
- "development tools",
32
- "software development",
33
- "private network integration"
29
+ "TypeScript",
30
+ "Rust",
31
+ "SmartProxy",
32
+ "DcRouter",
33
+ "flow control"
34
34
  ]
35
35
  },
36
36
  "release": {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/remoteingress',
6
- version: '4.14.1',
6
+ version: '4.14.3',
7
7
  description: 'Edge ingress tunnel for DcRouter - tunnels TCP and UDP traffic from the network edge to SmartProxy over TLS or QUIC, preserving client IP via PROXY protocol.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSwyQkFBMkI7SUFDakMsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLCtKQUErSjtDQUM3SyxDQUFBIn0=
package/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Task Venture Capital GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/remoteingress",
3
- "version": "4.14.1",
3
+ "version": "4.14.3",
4
4
  "private": false,
5
5
  "description": "Edge ingress tunnel for DcRouter - tunnels TCP and UDP traffic from the network edge to SmartProxy over TLS or QUIC, preserving client IP via PROXY protocol.",
6
6
  "main": "dist_ts/index.js",
@@ -14,17 +14,17 @@
14
14
  "buildDocs": "(tsdoc)"
15
15
  },
16
16
  "devDependencies": {
17
- "@git.zone/tsbuild": "^4.1.2",
18
- "@git.zone/tsbundle": "^2.8.3",
19
- "@git.zone/tsrun": "^2.0.1",
20
- "@git.zone/tsrust": "^1.3.0",
21
- "@git.zone/tstest": "^3.1.8",
17
+ "@git.zone/tsbuild": "^4.4.0",
18
+ "@git.zone/tsbundle": "^2.10.0",
19
+ "@git.zone/tsrun": "^2.0.2",
20
+ "@git.zone/tsrust": "^1.3.2",
21
+ "@git.zone/tstest": "^3.6.0",
22
22
  "@push.rocks/tapbundle": "^6.0.3",
23
- "@types/node": "^25.3.0"
23
+ "@types/node": "^25.5.0"
24
24
  },
25
25
  "dependencies": {
26
26
  "@push.rocks/qenv": "^6.1.3",
27
- "@push.rocks/smartrust": "^1.2.1"
27
+ "@push.rocks/smartrust": "^1.3.2"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
@@ -47,7 +47,7 @@
47
47
  "dist_rust/**/*",
48
48
  "assets/**/*",
49
49
  "cli.js",
50
- "npmextra.json",
50
+ ".smartconfig.json",
51
51
  "readme.md"
52
52
  ],
53
53
  "keywords": [
package/readme.md CHANGED
@@ -12,23 +12,24 @@ For reporting bugs, issues, or security vulnerabilities, please visit [community
12
12
  pnpm install @serve.zone/remoteingress
13
13
  ```
14
14
 
15
- ## 🏗️ Architecture
15
+ ## Architecture
16
16
 
17
17
  `@serve.zone/remoteingress` uses a **Hub/Edge** topology with a high-performance Rust core and a TypeScript API surface:
18
18
 
19
19
  ```
20
- ┌─────────────────────┐ TLS or QUIC Tunnel ┌─────────────────────┐
21
- │ Network Edge │ ◄══════════════════════════► │ Private Cluster │
22
- │ TCP+TLS: frame mux │
23
- RemoteIngressEdge │ QUIC: native streams RemoteIngressHub
24
- │ UDP: QUIC datagrams │
25
- Accepts TCP & UDP Forwards to
26
- on hub-assigned SmartProxy on
27
- ports local ports
28
- └─────────────────────┘ └─────────────────────┘
29
- ▲ │
30
- TCP + UDP from end users ▼
31
- Internet DcRouter / SmartProxy
20
+ TLS or QUIC Tunnel
21
+ ┌─────────────────────┐ ◄══════════════════════════► ┌─────────────────────┐
22
+ Network Edge │ TCP+TLS: frame mux │ Private Cluster
23
+ │ QUIC: native streams
24
+ RemoteIngressEdge │ UDP: QUIC datagrams │ RemoteIngressHub
25
+
26
+ Accepts TCP & UDP Forwards to
27
+ on hub-assigned SmartProxy on
28
+ │ ports │ │ local ports │
29
+ └─────────────────────┘ └─────────────────────┘
30
+
31
+ │ TCP + UDP from end users ▼
32
+ Internet DcRouter / SmartProxy
32
33
  ```
33
34
 
34
35
  | Component | Role |
@@ -37,24 +38,25 @@ pnpm install @serve.zone/remoteingress
37
38
  | **RemoteIngressHub** | Deployed alongside DcRouter/SmartProxy in a private cluster. Accepts edge connections, demuxes streams/datagrams, and forwards each to SmartProxy with PROXY protocol headers so the real client IP is preserved. |
38
39
  | **Rust Binary** (`remoteingress-bin`) | The performance-critical networking core. Managed via `@push.rocks/smartrust` RustBridge IPC — you never interact with it directly. Cross-compiled for `linux/amd64` and `linux/arm64`. |
39
40
 
40
- ### Key Features
41
-
42
- - 🔒 **Dual transport** — choose between TCP+TLS (frame-multiplexed) or QUIC (native stream multiplexing, zero head-of-line blocking)
43
- - 🌐 **TCP + UDP tunneling** — tunnel any TCP connection or UDP datagram through the same edge/hub pair
44
- - 📋 **PROXY protocol v1 & v2** — SmartProxy sees the real client IP for both TCP (v1 text) and UDP (v2 binary)
45
- - 🔀 **Multiplexed streams** — thousands of concurrent TCP connections over a single tunnel
46
- - **QUIC datagrams** — UDP traffic forwarded via QUIC unreliable datagrams for lowest possible latency
47
- - 🔑 **Shared-secret authentication** — edges must present valid credentials to connect
48
- - 🎫 **Connection tokens** — encode all connection details into a single opaque base64url string
49
- - 📡 **STUN-based public IP discovery** — edges automatically discover their public IP via Cloudflare STUN
50
- - 🔄 **Auto-reconnect** with exponential backoff if the tunnel drops
51
- - 🎛️ **Dynamic port configuration** — the hub assigns TCP and UDP listen ports per edge, hot-reloadable at runtime
52
- - 📣 **Event-driven** — both Hub and Edge extend `EventEmitter` for real-time monitoring
53
- - 🎚️ **3-tier QoS** — control frames, normal data, and sustained (elephant flow) traffic each get their own priority queue
54
- - 📊 **Adaptive flow control** — per-stream windows scale with active stream count to prevent memory overuse
55
- - 🕒 **UDP session management** — automatic session tracking with 60s idle timeout and cleanup
56
-
57
- ## 🚀 Usage
41
+ ### Key Features
42
+
43
+ - **Dual transport** — choose between TCP+TLS (frame-multiplexed) or QUIC (native stream multiplexing, zero head-of-line blocking)
44
+ - **TCP + UDP tunneling** — tunnel any TCP connection or UDP datagram through the same edge/hub pair
45
+ - **PROXY protocol v1 & v2** — SmartProxy sees the real client IP for both TCP (v1 text) and UDP (v2 binary)
46
+ - **Multiplexed streams** — thousands of concurrent TCP connections over a single tunnel
47
+ - **QUIC datagrams** — UDP traffic forwarded via QUIC unreliable datagrams for lowest possible latency
48
+ - **Shared-secret authentication** — edges must present valid credentials to connect
49
+ - **Connection tokens** — encode all connection details into a single opaque base64url string
50
+ - **STUN-based public IP discovery** — edges automatically discover their public IP via Cloudflare STUN
51
+ - **Auto-reconnect** with exponential backoff if the tunnel drops
52
+ - **Dynamic port configuration** — the hub assigns TCP and UDP listen ports per edge, hot-reloadable at runtime
53
+ - **Event-driven** — both Hub and Edge extend `EventEmitter` for real-time monitoring
54
+ - **3-tier QoS** — control frames, normal data, and sustained (elephant flow) traffic each get their own priority queue
55
+ - **Adaptive flow control** — per-stream windows scale with active stream count to prevent memory overuse
56
+ - **UDP session management** — automatic session tracking with 60s idle timeout and cleanup
57
+ - **Crash recovery** — automatic restart with exponential backoff if the Rust binary crashes unexpectedly
58
+
59
+ ## Usage
58
60
 
59
61
  Both classes are imported from the package and communicate with the Rust binary under the hood.
60
62
 
@@ -160,7 +162,7 @@ await edge.stop();
160
162
  | `'quic'` | QUIC with native stream multiplexing. Eliminates head-of-line blocking. Uses QUIC datagrams for UDP traffic. |
161
163
  | `'quicWithFallback'` | Tries QUIC first (5s timeout), falls back to TCP+TLS if UDP is blocked by the network. |
162
164
 
163
- ### 🎫 Connection Tokens
165
+ ### Connection Tokens
164
166
 
165
167
  Encode all connection details into a single opaque string for easy distribution:
166
168
 
@@ -183,30 +185,30 @@ const data = decodeConnectionToken(token);
183
185
 
184
186
  Tokens are base64url-encoded — safe for environment variables, CLI arguments, and config files.
185
187
 
186
- ## 📖 API Reference
188
+ ## API Reference
187
189
 
188
190
  ### `RemoteIngressHub`
189
191
 
190
192
  | Method / Property | Description |
191
193
  |-------------------|-------------|
192
- | `start(config?)` | Start the hub. Config: `{ tunnelPort?: number, targetHost?: string }`. Listens on both TCP and UDP (QUIC) on the tunnel port. |
194
+ | `start(config?)` | Start the hub. Config: `{ tunnelPort?, targetHost?, tls?: { certPem?, keyPem? } }`. Listens on both TCP and UDP (QUIC) on the tunnel port. |
193
195
  | `stop()` | Graceful shutdown. |
194
196
  | `updateAllowedEdges(edges)` | Set authorized edges. Each: `{ id, secret, listenPorts?, listenPortsUdp?, stunIntervalSecs? }`. Port changes are pushed to connected edges in real time. |
195
197
  | `getStatus()` | Returns `{ running, tunnelPort, connectedEdges: [...] }`. |
196
198
  | `running` | `boolean` — whether the Rust binary is alive. |
197
199
 
198
- **Events:** `edgeConnected`, `edgeDisconnected`, `streamOpened`, `streamClosed`
200
+ **Events:** `edgeConnected`, `edgeDisconnected`, `streamOpened`, `streamClosed`, `crashRecovered`, `crashRecoveryFailed`
199
201
 
200
202
  ### `RemoteIngressEdge`
201
203
 
202
204
  | Method / Property | Description |
203
205
  |-------------------|-------------|
204
- | `start(config)` | Connect to hub. Accepts `{ token }` or `{ hubHost, hubPort, edgeId, secret, transportMode? }`. |
206
+ | `start(config)` | Connect to hub. Accepts `{ token }` or `{ hubHost, hubPort, edgeId, secret, bindAddress?, transportMode? }`. |
205
207
  | `stop()` | Graceful shutdown. |
206
208
  | `getStatus()` | Returns `{ running, connected, publicIp, activeStreams, listenPorts }`. |
207
209
  | `running` | `boolean` — whether the Rust binary is alive. |
208
210
 
209
- **Events:** `tunnelConnected`, `tunnelDisconnected`, `publicIpDiscovered`, `portsAssigned`, `portsUpdated`
211
+ **Events:** `tunnelConnected`, `tunnelDisconnected`, `publicIpDiscovered`, `portsAssigned`, `portsUpdated`, `crashRecovered`, `crashRecoveryFailed`
210
212
 
211
213
  ### Token Utilities
212
214
 
@@ -221,6 +223,10 @@ Tokens are base64url-encoded — safe for environment variables, CLI arguments,
221
223
  interface IHubConfig {
222
224
  tunnelPort?: number; // default: 8443
223
225
  targetHost?: string; // default: '127.0.0.1'
226
+ tls?: {
227
+ certPem?: string; // PEM-encoded TLS certificate
228
+ keyPem?: string; // PEM-encoded TLS private key
229
+ };
224
230
  }
225
231
 
226
232
  interface IEdgeConfig {
@@ -240,7 +246,7 @@ interface IConnectionTokenData {
240
246
  }
241
247
  ```
242
248
 
243
- ## 🔌 Wire Protocol
249
+ ## Wire Protocol
244
250
 
245
251
  ### TCP+TLS Transport (Frame Protocol)
246
252
 
@@ -252,19 +258,19 @@ The tunnel uses a custom binary frame protocol over a single TLS connection:
252
258
 
253
259
  | Frame Type | Value | Direction | Purpose |
254
260
  |------------|-------|-----------|---------|
255
- | `OPEN` | `0x01` | Edge Hub | Open TCP stream; payload is PROXY v1 header |
256
- | `DATA` | `0x02` | Edge Hub | Client data (upload) |
257
- | `CLOSE` | `0x03` | Edge Hub | Client closed connection |
258
- | `DATA_BACK` | `0x04` | Hub Edge | Response data (download) |
259
- | `CLOSE_BACK` | `0x05` | Hub Edge | Upstream closed connection |
260
- | `CONFIG` | `0x06` | Hub Edge | Runtime config update (JSON payload) |
261
- | `PING` | `0x07` | Hub Edge | Heartbeat probe (every 15s) |
262
- | `PONG` | `0x08` | Edge Hub | Heartbeat response |
263
- | `WINDOW_UPDATE` | `0x09` | Edge Hub | Flow control: edge consumed N bytes |
264
- | `WINDOW_UPDATE_BACK` | `0x0A` | Hub Edge | Flow control: hub consumed N bytes |
265
- | `UDP_OPEN` | `0x0B` | Edge Hub | Open UDP session; payload is PROXY v2 header |
266
- | `UDP_DATA` | `0x0C` | Edge Hub | UDP datagram (upload) |
267
- | `UDP_DATA_BACK` | `0x0D` | Hub Edge | UDP datagram (download) |
261
+ | `OPEN` | `0x01` | Edge -> Hub | Open TCP stream; payload is PROXY v1 header |
262
+ | `DATA` | `0x02` | Edge -> Hub | Client data (upload) |
263
+ | `CLOSE` | `0x03` | Edge -> Hub | Client closed connection |
264
+ | `DATA_BACK` | `0x04` | Hub -> Edge | Response data (download) |
265
+ | `CLOSE_BACK` | `0x05` | Hub -> Edge | Upstream closed connection |
266
+ | `CONFIG` | `0x06` | Hub -> Edge | Runtime config update (JSON payload) |
267
+ | `PING` | `0x07` | Hub -> Edge | Heartbeat probe (every 15s) |
268
+ | `PONG` | `0x08` | Edge -> Hub | Heartbeat response |
269
+ | `WINDOW_UPDATE` | `0x09` | Edge -> Hub | Flow control: edge consumed N bytes |
270
+ | `WINDOW_UPDATE_BACK` | `0x0A` | Hub -> Edge | Flow control: hub consumed N bytes |
271
+ | `UDP_OPEN` | `0x0B` | Edge -> Hub | Open UDP session; payload is PROXY v2 header |
272
+ | `UDP_DATA` | `0x0C` | Edge -> Hub | UDP datagram (upload) |
273
+ | `UDP_DATA_BACK` | `0x0D` | Hub -> Edge | UDP datagram (download) |
268
274
  | `UDP_CLOSE` | `0x0E` | Either | Close UDP session |
269
275
 
270
276
  ### QUIC Transport
@@ -284,15 +290,15 @@ When using QUIC, the frame protocol is replaced by native QUIC primitives:
284
290
  4. Edge starts TCP and UDP listeners on the assigned ports
285
291
  5. Data flows — TCP frames/QUIC streams for TCP traffic, UDP frames/QUIC datagrams for UDP traffic
286
292
 
287
- ## 🎚️ QoS & Flow Control
293
+ ## QoS & Flow Control
288
294
 
289
295
  ### Priority Tiers (TCP+TLS Transport)
290
296
 
291
297
  | Tier | Frames | Behavior |
292
298
  |------|--------|----------|
293
- | 🔴 **Control** | PING, PONG, WINDOW_UPDATE, OPEN, CLOSE, CONFIG | Always drained first. Never delayed. |
294
- | 🟡 **Data** | DATA/DATA_BACK from normal streams, UDP frames | Drained when control queue is empty. |
295
- | 🟢 **Sustained** | DATA/DATA_BACK from elephant flows | Lowest priority with guaranteed **1 MB/s** drain rate. |
299
+ | **Control** | PING, PONG, WINDOW_UPDATE, OPEN, CLOSE, CONFIG | Always drained first. Never delayed. |
300
+ | **Data** | DATA/DATA_BACK from normal streams, UDP frames | Drained when control queue is empty. |
301
+ | **Sustained** | DATA/DATA_BACK from elephant flows | Lowest priority with guaranteed **1 MB/s** drain rate. |
296
302
 
297
303
  ### Sustained Stream Classification
298
304
 
@@ -308,13 +314,13 @@ Each TCP stream has a send window from a shared **200 MB budget**:
308
314
 
309
315
  | Active Streams | Window per Stream |
310
316
  |---|---|
311
- | 150 | 4 MB (maximum) |
312
- | 51200 | Scales down (4 MB 1 MB) |
317
+ | 1-50 | 4 MB (maximum) |
318
+ | 51-200 | Scales down (4 MB -> 1 MB) |
313
319
  | 200+ | 1 MB (floor) |
314
320
 
315
321
  UDP traffic uses no flow control — datagrams are fire-and-forget, matching UDP semantics.
316
322
 
317
- ## 💡 Example Scenarios
323
+ ## Example Scenarios
318
324
 
319
325
  ### 1. Expose a Private Cluster to the Internet
320
326
 
@@ -358,6 +364,8 @@ await edge.start({
358
364
  Generate connection tokens on the hub side and distribute them to edge operators:
359
365
 
360
366
  ```typescript
367
+ import { encodeConnectionToken, RemoteIngressEdge } from '@serve.zone/remoteingress';
368
+
361
369
  const token = encodeConnectionToken({
362
370
  hubHost: 'hub.prod.example.com',
363
371
  hubPort: 8443,
@@ -372,21 +380,19 @@ await edge.start({ token });
372
380
 
373
381
  ## License and Legal Information
374
382
 
375
- This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
383
+ 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.
376
384
 
377
385
  **Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
378
386
 
379
387
  ### Trademarks
380
388
 
381
- This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
382
-
383
- Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
389
+ This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
384
390
 
385
391
  ### Company Information
386
392
 
387
393
  Task Venture Capital GmbH
388
- Registered at District Court Bremen HRB 35230 HB, Germany
394
+ Registered at District court Bremen HRB 35230 HB, Germany
389
395
 
390
- For any legal inquiries or further information, please contact us via email at hello@task.vc.
396
+ For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
391
397
 
392
398
  By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/remoteingress',
6
- version: '4.14.1',
6
+ version: '4.14.3',
7
7
  description: 'Edge ingress tunnel for DcRouter - tunnels TCP and UDP traffic from the network edge to SmartProxy over TLS or QUIC, preserving client IP via PROXY protocol.'
8
8
  }