Custom VLESS Transport: Reverse Proxy CDNs, DPI Evasion, and Kernel Splicing
Engineering an undetectable anti-censorship proxy: Nginx SNI fallbacks, CDN reverse proxies, uTLS fingerprint emulation, and zero-copy kernel splicing.
- Networking
- VLESS
- Security
- Linux Kernel
- Infrastructure
The Threat Model: Active Probing and Statistical DPI
Modern Deep Packet Inspection (DPI) systems operate on two distinct detection axes: 1. Passive Flow Analysis: inspecting TLS ClientHello signatures (JA3/JA4 fingerprints, cipher suite order, ALPN negotiation), SNI plaintext headers, and statistical packet-length distribution sequences. 2. Active Probing: automated scanner botnets sending invalid handshake probes or raw TLS frames to suspected proxy IPs to verify if the port behaves like an open proxy or an authentic HTTPS web server.
To achieve long-term connection survivability on hostile networks, Beaxty VPN was engineered with a completely customized VLESS transport, CDN reverse proxying, and kernel-level socket acceleration.
[ Client: uTLS + Packet Fragmentation ]
|
(Encrypted TLS 1.3 / gRPC)
v
[ Nginx Stream + ssl_preread SNI Map ]
├── Valid Auth (VLESS) ──> [ Custom VLESS Engine ] ──> [ Kernel splice() ] ──> Target
└── Probe / Scanner ──> [ Decoy Fallback Server ] (Genuine HTTPS 200/404 Web Service)
1. Nginx Stream Reverse Proxying with SNI Fallbacks
Rather than exposing the proxy core directly on port 443, we front the ingress with an Nginx stream pipeline using ssl_preread and SNI multiplexing:
stream {
map $ssl_preread_server_name $backend_pool {
app.beaxty-internal.net vless_core;
default decoy_web_server;
}
upstream vless_core {
server 127.0.0.1:10443;
}
upstream decoy_web_server {
server 127.0.0.1:8443;
}
server {
listen 443 reuseport;
proxy_pass $backend_pool;
ssl_preread on;
proxy_connect_timeout 5s;
}
}
- Authenticated Handshakes: incoming connections carrying our designated internal SNI or valid cryptographic VLESS headers route directly to the proxy engine.
- Active Scanner Immunity: unsolicited scans, Shodan crawlers, and censor probes match the
defaultupstream and are transparently forwarded to an authentic HTTPS web server returning legitimate TLS certificates and static HTML pages. Active probes observe a standard corporate website with zero proxy indicators.
2. uTLS Fingerprint Spoofing & TCP Fragmentation
Standard Go/Rust network stacks leak recognizable ClientHello signatures. Our client core incorporates uTLS with dynamic fingerprint rotation:
- Browser Emulation: exactly mirrors Google Chrome, Safari, and Firefox TLS extension permutations, ALPN protocols (
h2,http/1.1), and GREASE values. - TCP Packet Fragmentation: splits the initial TLS ClientHello frame across non-standard TCP segment boundaries (e.g., 5 bytes + remaining payload), preventing DPI hardware from regex-matching the SNI string in the first packet.
- Dynamic Frame Padding: injects randomized entropy padding into early data frames, destroying the statistical packet-length clusters used by machine-learning traffic classifiers.
3. CDN Reverse Proxying & Multiplexing
For aggressive firewall zones, traffic is encapsulated over WebSocket or gRPC streams fronted by multi-tier CDN reverse proxies:
- 0-RTT Early Data: embeds the initial VLESS request header directly inside the HTTP upgrade handshake, eliminating round-trip handshake latency.
- Multiplexed Connection Pooling: aggregates dozens of client logical streams over a single persistent TLS connection, masking individual browsing spikes into a steady HTTPS data stream.
4. Kernel-Level Zero-Copy Splicing (splice() Syscall)
In high-concurrency proxy nodes, transferring gigabytes of encrypted streams between user-space buffers and network sockets causes severe CPU cache thrashing and memory overhead.
// Kernel-level pipe splicing eliminating user-space buffer copies
while ((bytes_piped = splice(client_fd, NULL, pipe_fd[1], NULL, BUF_SIZE, SPLICE_F_MOVE | SPLICE_F_MORE)) > 0) {
splice(pipe_fd[0], NULL, upstream_fd, NULL, bytes_piped, SPLICE_F_MOVE | SPLICE_F_MORE);
}
By transitioning the forwarding core to Linux direct socket splicing and tuning TCP buffers with BBR congestion control, we achieved: - 35% increase in peak socket throughput on high-latency international links. - Sub-4KB memory footprint per connection, allowing small edge VPS nodes to sustain tens of thousands of active concurrent tunnels without degradation.
# Production Linux network stack tuning
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="4096 65536 16777216"
sysctl -w net.ipv4.tcp_congestion_control=bbr