@push.rocks/smartvpn 1.10.1 → 1.11.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.
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartvpn',
6
- version: '1.10.1',
6
+ version: '1.11.0',
7
7
  description: 'A VPN solution with TypeScript control plane and Rust data plane daemon'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHlFQUF5RTtDQUN2RixDQUFBIn0=
@@ -79,12 +79,15 @@ export interface IVpnServerConfig {
79
79
  defaultRateLimitBytesPerSec?: number;
80
80
  /** Default burst size for new clients (bytes). Omit for unlimited. */
81
81
  defaultBurstBytes?: number;
82
- /** Transport mode: 'both' (default, WS+QUIC), 'websocket', 'quic', or 'wireguard' */
83
- transportMode?: 'websocket' | 'quic' | 'both' | 'wireguard';
82
+ /** Transport mode: 'all' (default, WS+QUIC+WG if configured), 'both' (WS+QUIC),
83
+ * 'websocket', 'quic', or 'wireguard' */
84
+ transportMode?: 'websocket' | 'quic' | 'both' | 'all' | 'wireguard';
84
85
  /** QUIC listen address (host:port). Defaults to listenAddr. */
85
86
  quicListenAddr?: string;
86
87
  /** QUIC idle timeout in seconds (default: 30) */
87
88
  quicIdleTimeoutSecs?: number;
89
+ /** WireGuard: server X25519 private key (base64). Required when transport includes WG. */
90
+ wgPrivateKey?: string;
88
91
  /** WireGuard: UDP listen port (default: 51820) */
89
92
  wgListenPort?: number;
90
93
  /** WireGuard: configured peers */
@@ -139,6 +142,8 @@ export interface IVpnClientInfo {
139
142
  registeredClientId: string;
140
143
  /** Real client IP:port (from PROXY protocol or direct TCP connection) */
141
144
  remoteAddr?: string;
145
+ /** Transport used: "websocket", "quic", or "wireguard" */
146
+ transportType: string;
142
147
  }
143
148
  export interface IVpnServerStatistics extends IVpnStatistics {
144
149
  activeClients: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@push.rocks/smartvpn",
3
- "version": "1.10.1",
3
+ "version": "1.11.0",
4
4
  "private": false,
5
5
  "description": "A VPN solution with TypeScript control plane and Rust data plane daemon",
6
6
  "type": "module",
package/readme.md CHANGED
@@ -9,7 +9,7 @@ A high-performance VPN solution with a **TypeScript control plane** and a **Rust
9
9
  📊 **Adaptive QoS**: per-client rate limiting, priority queues, connection quality tracking
10
10
  🔄 **Hub API**: one `createClient()` call generates keys, assigns IP, returns both SmartVPN + WireGuard configs
11
11
  📡 **Real-time telemetry**: RTT, jitter, loss ratio, link health — all via typed APIs
12
- 🌐 **Flexible forwarding**: TUN device (kernel), userspace NAT (no root), or testing mode
12
+ 🌐 **Unified forwarding pipeline**: all transports share the same engine — TUN (kernel), userspace NAT (no root), or testing mode
13
13
 
14
14
  ## Issue Reporting and Security
15
15
 
@@ -54,8 +54,9 @@ await server.start({
54
54
  privateKey: '<server-noise-private-key-base64>',
55
55
  publicKey: '<server-noise-public-key-base64>',
56
56
  subnet: '10.8.0.0/24',
57
- transportMode: 'both', // WebSocket + QUIC simultaneously
57
+ transportMode: 'all', // WebSocket + QUIC + WireGuard simultaneously (default)
58
58
  forwardingMode: 'tun', // 'tun' (kernel), 'socket' (userspace NAT), or 'testing'
59
+ wgPrivateKey: '<server-wg-private-key-base64>', // required for WireGuard transport
59
60
  enableNat: true,
60
61
  dns: ['1.1.1.1', '8.8.8.8'],
61
62
  });
@@ -109,7 +110,7 @@ Every client authenticates with a **Noise IK handshake** (`Noise_IK_25519_ChaCha
109
110
  | **QUIC** | UDP (via quinn) | Low latency, datagram support for IP packets |
110
111
  | **WireGuard** | UDP (via boringtun) | Standard WG clients (iOS, Android, wg-quick) |
111
112
 
112
- The server can run **all three simultaneously** with `transportMode: 'both'` (WS + QUIC) or `'wireguard'`. Clients auto-negotiate with `transport: 'auto'` (tries QUIC first, falls back to WS).
113
+ The server runs **all three simultaneously** by default with `transportMode: 'all'`. All transports share the same unified forwarding pipeline (`ForwardingEngine`), IP pool, client registry, and stats — so WireGuard peers get the same userspace NAT, rate limiting, and monitoring as WS/QUIC clients. Clients auto-negotiate with `transport: 'auto'` (tries QUIC first, falls back to WS).
113
114
 
114
115
  ### 🛡️ ACL Engine (SmartProxy-Aligned)
115
116
 
@@ -313,19 +314,24 @@ const unit = VpnInstaller.generateServiceUnit({
313
314
  ### Server Configuration
314
315
 
315
316
  ```typescript
317
+ // All transports simultaneously (default) — WS + QUIC + WireGuard
318
+ { transportMode: 'all', listenAddr: '0.0.0.0:443', wgPrivateKey: '...', wgListenPort: 51820 }
319
+
320
+ // WS + QUIC only (backward compat)
321
+ { transportMode: 'both', listenAddr: '0.0.0.0:443', quicListenAddr: '0.0.0.0:4433' }
322
+
316
323
  // WebSocket only
317
324
  { transportMode: 'websocket', listenAddr: '0.0.0.0:443' }
318
325
 
319
326
  // QUIC only
320
327
  { transportMode: 'quic', listenAddr: '0.0.0.0:443' }
321
328
 
322
- // Both (WS + QUIC on same or different ports)
323
- { transportMode: 'both', listenAddr: '0.0.0.0:443', quicListenAddr: '0.0.0.0:4433' }
324
-
325
- // WireGuard
326
- { transportMode: 'wireguard', wgListenPort: 51820, wgPeers: [...] }
329
+ // WireGuard only
330
+ { transportMode: 'wireguard', wgPrivateKey: '...', wgListenPort: 51820, wgPeers: [...] }
327
331
  ```
328
332
 
333
+ All transport modes share the same `forwardingMode` — WireGuard peers can use `'socket'` (userspace NAT) just like WS/QUIC clients.
334
+
329
335
  ### Client Configuration
330
336
 
331
337
  ```typescript
@@ -418,7 +424,7 @@ smartvpn/
418
424
 
419
425
  ## License and Legal Information
420
426
 
421
- This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
427
+ 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.
422
428
 
423
429
  **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.
424
430
 
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartvpn',
6
- version: '1.10.1',
6
+ version: '1.11.0',
7
7
  description: 'A VPN solution with TypeScript control plane and Rust data plane daemon'
8
8
  }
@@ -96,12 +96,15 @@ export interface IVpnServerConfig {
96
96
  defaultRateLimitBytesPerSec?: number;
97
97
  /** Default burst size for new clients (bytes). Omit for unlimited. */
98
98
  defaultBurstBytes?: number;
99
- /** Transport mode: 'both' (default, WS+QUIC), 'websocket', 'quic', or 'wireguard' */
100
- transportMode?: 'websocket' | 'quic' | 'both' | 'wireguard';
99
+ /** Transport mode: 'all' (default, WS+QUIC+WG if configured), 'both' (WS+QUIC),
100
+ * 'websocket', 'quic', or 'wireguard' */
101
+ transportMode?: 'websocket' | 'quic' | 'both' | 'all' | 'wireguard';
101
102
  /** QUIC listen address (host:port). Defaults to listenAddr. */
102
103
  quicListenAddr?: string;
103
104
  /** QUIC idle timeout in seconds (default: 30) */
104
105
  quicIdleTimeoutSecs?: number;
106
+ /** WireGuard: server X25519 private key (base64). Required when transport includes WG. */
107
+ wgPrivateKey?: string;
105
108
  /** WireGuard: UDP listen port (default: 51820) */
106
109
  wgListenPort?: number;
107
110
  /** WireGuard: configured peers */
@@ -171,6 +174,8 @@ export interface IVpnClientInfo {
171
174
  registeredClientId: string;
172
175
  /** Real client IP:port (from PROXY protocol or direct TCP connection) */
173
176
  remoteAddr?: string;
177
+ /** Transport used: "websocket", "quic", or "wireguard" */
178
+ transportType: string;
174
179
  }
175
180
 
176
181
  export interface IVpnServerStatistics extends IVpnStatistics {