How nonstopble/revpn works
ReVPN provides interoperable C++ and Python implementations of a TUN-based mesh VPN. The main workflow is to configure a node, connect clients to a rendezvous server, register VPN identities, establish direct UDP peer paths when possible, and otherwise relay traffic through the server; clients bridge packets between TUN and UDP, optionally encrypting tunnel data. The README also documents decentralized token-based peer setup and optional AF_XDP acceleration. Python source excerpts are partial, and the C++ engine is one large source file, so uncertain internal wiring is omitted.
Main entry points: meshvpn.cpp C++ VPN engine · client.py Python client · cli.py CLI and modes · server.py Python rendezvous
Components 16
User entry
- CLI and modes
python/ReVPN/cli.py - Interactive menu
python/ReVPN/curses_tui.py - Saved settings
python/ReVPN/cli.py
Python runtime
- Python client
python/ReVPN/client.py - Python rendezvous
python/ReVPN/server.py - Wire protocol
python/ReVPN/protocol.py - Python TUN
python/ReVPN/tun.py
C++ runtime
- C++ VPN engine
engine/meshvpn.cpp - Virtual network
engine/meshvpn.cpp
Packet acceleration
- AF_XDP sockets
engine/xdp_sock.cpp - XDP filter
engine/xdp_kern.c
Other components
- VPN operator
- VPN peers
- UDP network
- STUN service
- Peer token exchange
Connections 22
- VPN operator → CLI and modes: configures
- CLI and modes → Interactive menu: opens menu
- CLI and modes → Saved settings: loads and saves
- CLI and modes → Python rendezvous: starts server
- CLI and modes → Python client: starts client
- Python client → Python TUN: reads and writes
- Python client → Wire protocol: packs and parses
- Python rendezvous → Wire protocol: packs and parses
- Python client → UDP network: registers and sends
- Python rendezvous → UDP network: receives and relays
- Python client → VPN peers: punches and sends
- UDP network → Python client: delivers packets
- UDP network → Python rendezvous: delivers packets
- VPN operator → C++ VPN engine: selects mode
- C++ VPN engine → Virtual network: bridges packets
- C++ VPN engine → UDP network: registers and relays
- C++ VPN engine → VPN peers: punches and sends
- C++ VPN engine → STUN service: queries address
- VPN operator → Peer token exchange: exchanges out of band
- Peer token exchange → C++ VPN engine: provides peer setup
- C++ VPN engine → AF_XDP sockets: uses optionally
- AF_XDP sockets → XDP filter: receives redirected packets