How vedantb7/zerovpn works
ZeroVPN is a Linux VPN-like secure tunnel. Clients connect over TCP, receive a dynamically assigned VPN address, register it, then forward TUN packets through encrypted frames; the server decrypts client traffic into its TUN interface and supports multiple sessions. The documented product also includes route controls for split/full tunneling, DNS and internet access, monitoring, and CLI management. Some capabilities are documented but their full runtime implementation was not sampled, so uncertain links are omitted.
Main entry points: tcp_server.cpp TCP server · client.cpp Namespace client · server_cli.cpp Server CLI · host_client.cpp Host client
Components 18
VPN clients
- Namespace client
client/client.cpp - Host client
client/host_client.cpp
Tunnel server
- TCP server
server/tcp_server.cpp - Server startup
server/tunnel_server.cpp - Client sessions
common/sessions.cpp - VPN IP allocation
common/ip_allocator.cpp
Tunnel primitives
- Client TUN forwarding
common/tun.cpp - Server TUN forwarding
common/tun.cpp - Framing
common/packet.cpp - Packet encryption
common/crypto.cpp
Routing and management
- Client CLI
common/client_cli.cpp - Route controls
common/routes.cpp - Forwarding rules
common/forwarding_rules.cpp - Server CLI
common/server_cli.cpp - Traffic statistics
common/stats.cpp
Other components
- VPN operator
- Destination endpoint
server/destination_server.cpp - Internet services
Connections 26
- VPN operator → Namespace client: starts tunnel
README.md - VPN operator → Host client: starts optionally
README.md - Namespace client → TCP server: connects TCP
client/client.cpp - Host client → TCP server: connects TCP
client/host_client.cpp - Namespace client → Framing: exchanges frames
client/client.cpp - Host client → Framing: exchanges frames
client/host_client.cpp - Namespace client → Client TUN forwarding: starts forwarding
client/client.cpp - Host client → Client TUN forwarding: starts forwarding
client/host_client.cpp - Namespace client → Client CLI: starts CLI
client/client.cpp - TCP server → VPN IP allocation: allocates address
server/tcp_server.cpp - TCP server → Client sessions: records sessions
server/tcp_server.cpp - TCP server → Framing: receives frames
server/tcp_server.cpp - TCP server → Packet encryption: decrypts packets
server/tcp_server.cpp - TCP server → Server TUN forwarding: writes packets
server/tcp_server.cpp - Server startup → TCP server: starts server
server/tunnel_server.cpp - Server startup → Server TUN forwarding: configures interface
server/tunnel_server.cpp - Client CLI → Route controls: controls routes
common/client_cli.cpp - Client CLI → Traffic statistics: prints statistics
common/client_cli.cpp - Server CLI → TCP server: controls server
common/server_cli.cpp - Server CLI → Client sessions: lists sessions
common/server_cli.cpp - Server CLI → Traffic statistics: prints statistics
common/server_cli.cpp - Server CLI → Forwarding rules: controls rules
common/server_cli.cpp - Client TUN forwarding → Packet encryption: encrypts packets
- Server TUN forwarding → Internet services: routes traffic
README.md - Server TUN forwarding → Destination endpoint: forwards traffic
README.md - Route controls → Internet services: enables tunneling
README.md