@push.rocks/smartvpn 1.10.2 → 1.12.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/dist_rust/smartvpn_daemon_linux_amd64 +0 -0
- package/dist_rust/smartvpn_daemon_linux_arm64 +0 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/smartvpn.interfaces.d.ts +12 -2
- package/package.json +1 -1
- package/readme.md +15 -9
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/smartvpn.interfaces.ts +12 -2
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartvpn',
|
|
6
|
-
version: '1.
|
|
6
|
+
version: '1.12.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: '
|
|
83
|
-
|
|
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 */
|
|
@@ -98,6 +101,11 @@ export interface IVpnServerConfig {
|
|
|
98
101
|
/** Server-level IP block list — applied at TCP accept, before Noise handshake.
|
|
99
102
|
* Supports exact IPs, CIDR, wildcards, ranges. */
|
|
100
103
|
connectionIpBlockList?: string[];
|
|
104
|
+
/** When true and forwardingMode is 'socket', the userspace NAT engine prepends
|
|
105
|
+
* PROXY protocol v2 headers on outbound TCP connections, conveying the VPN client's
|
|
106
|
+
* tunnel IP as the source address. This allows downstream services (e.g. SmartProxy)
|
|
107
|
+
* to see the real VPN client identity instead of 127.0.0.1. */
|
|
108
|
+
socketForwardProxyProtocol?: boolean;
|
|
101
109
|
}
|
|
102
110
|
export interface IVpnServerOptions {
|
|
103
111
|
transport: TVpnTransportOptions;
|
|
@@ -139,6 +147,8 @@ export interface IVpnClientInfo {
|
|
|
139
147
|
registeredClientId: string;
|
|
140
148
|
/** Real client IP:port (from PROXY protocol or direct TCP connection) */
|
|
141
149
|
remoteAddr?: string;
|
|
150
|
+
/** Transport used: "websocket", "quic", or "wireguard" */
|
|
151
|
+
transportType: string;
|
|
142
152
|
}
|
|
143
153
|
export interface IVpnServerStatistics extends IVpnStatistics {
|
|
144
154
|
activeClients: number;
|
package/package.json
CHANGED
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
|
-
🌐 **
|
|
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: '
|
|
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
|
|
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
|
-
//
|
|
323
|
-
{ transportMode: '
|
|
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 [
|
|
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
|
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -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: '
|
|
100
|
-
|
|
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 */
|
|
@@ -115,6 +118,11 @@ export interface IVpnServerConfig {
|
|
|
115
118
|
/** Server-level IP block list — applied at TCP accept, before Noise handshake.
|
|
116
119
|
* Supports exact IPs, CIDR, wildcards, ranges. */
|
|
117
120
|
connectionIpBlockList?: string[];
|
|
121
|
+
/** When true and forwardingMode is 'socket', the userspace NAT engine prepends
|
|
122
|
+
* PROXY protocol v2 headers on outbound TCP connections, conveying the VPN client's
|
|
123
|
+
* tunnel IP as the source address. This allows downstream services (e.g. SmartProxy)
|
|
124
|
+
* to see the real VPN client identity instead of 127.0.0.1. */
|
|
125
|
+
socketForwardProxyProtocol?: boolean;
|
|
118
126
|
}
|
|
119
127
|
|
|
120
128
|
export interface IVpnServerOptions {
|
|
@@ -171,6 +179,8 @@ export interface IVpnClientInfo {
|
|
|
171
179
|
registeredClientId: string;
|
|
172
180
|
/** Real client IP:port (from PROXY protocol or direct TCP connection) */
|
|
173
181
|
remoteAddr?: string;
|
|
182
|
+
/** Transport used: "websocket", "quic", or "wireguard" */
|
|
183
|
+
transportType: string;
|
|
174
184
|
}
|
|
175
185
|
|
|
176
186
|
export interface IVpnServerStatistics extends IVpnStatistics {
|