feat(server): add optional PROXY protocol v2 headers for socket-based userspace NAT forwarding

This commit is contained in:
2026-03-30 07:13:49 +00:00
parent af46dc9b39
commit 5bf21ab4ac
5 changed files with 39 additions and 3 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartvpn',
version: '1.11.0',
version: '1.12.0',
description: 'A VPN solution with TypeScript control plane and Rust data plane daemon'
}

View File

@@ -118,6 +118,11 @@ export interface IVpnServerConfig {
/** Server-level IP block list — applied at TCP accept, before Noise handshake.
* Supports exact IPs, CIDR, wildcards, ranges. */
connectionIpBlockList?: string[];
/** When true and forwardingMode is 'socket', the userspace NAT engine prepends
* PROXY protocol v2 headers on outbound TCP connections, conveying the VPN client's
* tunnel IP as the source address. This allows downstream services (e.g. SmartProxy)
* to see the real VPN client identity instead of 127.0.0.1. */
socketForwardProxyProtocol?: boolean;
}
export interface IVpnServerOptions {