@serve.zone/remoteingress 4.14.2 → 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.
package/.smartconfig.json CHANGED
@@ -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.2',
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/remoteingress",
3
- "version": "4.14.2",
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",
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,7 +185,7 @@ 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
 
@@ -195,18 +197,18 @@ Tokens are base64url-encoded — safe for environment variables, CLI arguments,
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
 
@@ -244,7 +246,7 @@ interface IConnectionTokenData {
244
246
  }
245
247
  ```
246
248
 
247
- ## 🔌 Wire Protocol
249
+ ## Wire Protocol
248
250
 
249
251
  ### TCP+TLS Transport (Frame Protocol)
250
252
 
@@ -256,19 +258,19 @@ The tunnel uses a custom binary frame protocol over a single TLS connection:
256
258
 
257
259
  | Frame Type | Value | Direction | Purpose |
258
260
  |------------|-------|-----------|---------|
259
- | `OPEN` | `0x01` | Edge Hub | Open TCP stream; payload is PROXY v1 header |
260
- | `DATA` | `0x02` | Edge Hub | Client data (upload) |
261
- | `CLOSE` | `0x03` | Edge Hub | Client closed connection |
262
- | `DATA_BACK` | `0x04` | Hub Edge | Response data (download) |
263
- | `CLOSE_BACK` | `0x05` | Hub Edge | Upstream closed connection |
264
- | `CONFIG` | `0x06` | Hub Edge | Runtime config update (JSON payload) |
265
- | `PING` | `0x07` | Hub Edge | Heartbeat probe (every 15s) |
266
- | `PONG` | `0x08` | Edge Hub | Heartbeat response |
267
- | `WINDOW_UPDATE` | `0x09` | Edge Hub | Flow control: edge consumed N bytes |
268
- | `WINDOW_UPDATE_BACK` | `0x0A` | Hub Edge | Flow control: hub consumed N bytes |
269
- | `UDP_OPEN` | `0x0B` | Edge Hub | Open UDP session; payload is PROXY v2 header |
270
- | `UDP_DATA` | `0x0C` | Edge Hub | UDP datagram (upload) |
271
- | `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) |
272
274
  | `UDP_CLOSE` | `0x0E` | Either | Close UDP session |
273
275
 
274
276
  ### QUIC Transport
@@ -288,15 +290,15 @@ When using QUIC, the frame protocol is replaced by native QUIC primitives:
288
290
  4. Edge starts TCP and UDP listeners on the assigned ports
289
291
  5. Data flows — TCP frames/QUIC streams for TCP traffic, UDP frames/QUIC datagrams for UDP traffic
290
292
 
291
- ## 🎚️ QoS & Flow Control
293
+ ## QoS & Flow Control
292
294
 
293
295
  ### Priority Tiers (TCP+TLS Transport)
294
296
 
295
297
  | Tier | Frames | Behavior |
296
298
  |------|--------|----------|
297
- | 🔴 **Control** | PING, PONG, WINDOW_UPDATE, OPEN, CLOSE, CONFIG | Always drained first. Never delayed. |
298
- | 🟡 **Data** | DATA/DATA_BACK from normal streams, UDP frames | Drained when control queue is empty. |
299
- | 🟢 **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. |
300
302
 
301
303
  ### Sustained Stream Classification
302
304
 
@@ -312,13 +314,13 @@ Each TCP stream has a send window from a shared **200 MB budget**:
312
314
 
313
315
  | Active Streams | Window per Stream |
314
316
  |---|---|
315
- | 150 | 4 MB (maximum) |
316
- | 51200 | Scales down (4 MB 1 MB) |
317
+ | 1-50 | 4 MB (maximum) |
318
+ | 51-200 | Scales down (4 MB -> 1 MB) |
317
319
  | 200+ | 1 MB (floor) |
318
320
 
319
321
  UDP traffic uses no flow control — datagrams are fire-and-forget, matching UDP semantics.
320
322
 
321
- ## 💡 Example Scenarios
323
+ ## Example Scenarios
322
324
 
323
325
  ### 1. Expose a Private Cluster to the Internet
324
326
 
@@ -362,6 +364,8 @@ await edge.start({
362
364
  Generate connection tokens on the hub side and distribute them to edge operators:
363
365
 
364
366
  ```typescript
367
+ import { encodeConnectionToken, RemoteIngressEdge } from '@serve.zone/remoteingress';
368
+
365
369
  const token = encodeConnectionToken({
366
370
  hubHost: 'hub.prod.example.com',
367
371
  hubPort: 8443,
@@ -376,21 +380,19 @@ await edge.start({ token });
376
380
 
377
381
  ## License and Legal Information
378
382
 
379
- This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license.md) 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.
380
384
 
381
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.
382
386
 
383
387
  ### Trademarks
384
388
 
385
- 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.
386
-
387
- 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.
388
390
 
389
391
  ### Company Information
390
392
 
391
393
  Task Venture Capital GmbH
392
- Registered at District Court Bremen HRB 35230 HB, Germany
394
+ Registered at District court Bremen HRB 35230 HB, Germany
393
395
 
394
- 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.
395
397
 
396
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.2',
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
  }