How dr-lexus-dr/bproto works
bProto is a VPN product spanning client apps, a Rust UDP protocol and Linux server, and a web control panel. The main user path is importing or selecting a server profile, connecting a client tunnel, carrying IP traffic through the encrypted protocol and server TUN/NAT datapath, and managing clients and subscriptions through bUI. The graph also preserves routing, stealth, stats, and platform integration branches. Source excerpts are selective; unsampled subsystem relationships are omitted unless the README or source index establishes them.
Main entry points: src/main.rs Panel backend · session.rs Encrypted sessions · src/main.rs Server process · MainActivity.kt Android app
Components 34
VPN Clients
- Android app
apps/android/app/src/main/kotlin/dev/bproto/MainActivity.kt - Profiles and imports
apps/android/app/src/main/kotlin/dev/bproto/ServerProfile.kt - Subscription import
apps/android/app/src/main/kotlin/dev/bproto/SubscriptionFetcher.kt - Android routing
apps/android/app/src/main/kotlin/dev/bproto/RoutingPolicy.kt - Android VPN service
apps/android/app/src/main/kotlin/dev/bproto/BprotoVpnService.kt - iOS tunnel provider
apps/ios/BprotoTunnelProvider.swift - Linux CLI
crates/vpn-cli/src/main.rs - JNI bridge
crates/vpn-ffi/src/jni.rs
VPN Protocol
- Tunnel configuration
crates/vpn-core/src/config.rs - Handshake and auth
crates/vpn-core/src/handshake.rs - Key derivation
crates/vpn-core/src/crypto.rs - Datagram framing
crates/vpn-core/src/packet.rs - Encrypted sessions
crates/vpn-core/src/session.rs - Acks and replay
crates/vpn-core/src/ack.rs - Congestion control
crates/vpn-core/src/congestion.rs - TLS masquerade
crates/vpn-core/src/masquerade/mod.rs
Linux Server
- Server process
crates/vpn-server/src/main.rs - Server configuration
crates/vpn-server/src/config.rs - VPN session node
crates/vpn-core/src/server.rs - TUN and NAT
crates/vpn-tun/src/dev.rs - Traffic splicer
crates/vpn-server/src/splicer.rs
bUI Panel
- Panel interface
panel/frontend/src/App.tsx - Panel API client
panel/frontend/src/api.ts - Routing editor
panel/frontend/src/RoutingEditor.tsx - Panel backend
panel/backend/src/main.rs - Admin authentication
panel/backend/src/auth.rs - Inbounds and clients
panel/backend/src/inbounds.rs - Client keys
panel/backend/src/keys.rs - Subscriptions
panel/backend/src/subs.rs - Routing rules
panel/backend/src/routing.rs - Traffic statistics
panel/backend/src/stats.rs - SQLite database
Other components
- Client user
- Panel administrator
Connections 35
- Client user → Android app: configures
README.md - Android app → Profiles and imports: manages profiles
apps/android/app/src/main/kotlin/dev/bproto/MainActivity.kt - Android app → Subscription import: fetches subscriptions
apps/android/app/src/main/kotlin/dev/bproto/MainActivity.kt - Android app → Android VPN service: starts tunnel
apps/android/app/src/main/kotlin/dev/bproto/MainActivity.kt - Android VPN service → Android routing: applies policy
apps/android/app/src/main/kotlin/dev/bproto/BprotoVpnService.kt - Android VPN service → JNI bridge: calls native bridge
- iOS tunnel provider → Encrypted sessions: uses protocol
- Linux CLI → Encrypted sessions: runs client tunnel
README.md - JNI bridge → Encrypted sessions: bridges client API
- Tunnel configuration → Handshake and auth: configures handshake
crates/vpn-core/src/handshake.rs - Handshake and auth → Key derivation: derives session keys
crates/vpn-core/src/handshake.rs - Encrypted sessions → Handshake and auth: performs handshake
crates/vpn-core/src/session.rs - Encrypted sessions → Datagram framing: frames datagrams
crates/vpn-core/src/session.rs - Encrypted sessions → Acks and replay: tracks acknowledgements
crates/vpn-core/src/session.rs - Encrypted sessions → Congestion control: controls sending
crates/vpn-core/src/session.rs - TLS masquerade → Handshake and auth: wraps handshake
crates/vpn-core/src/masquerade/mod.rs - Server process → Server configuration: loads configuration
crates/vpn-server/src/main.rs - Server process → VPN session node: runs protocol node
README.md - Server process → TUN and NAT: sets up datapath
README.md - VPN session node → Datagram framing: parses packets
crates/vpn-core/src/server.rs - VPN session node → Encrypted sessions: opens and seals
crates/vpn-core/src/server.rs - Server process → Traffic splicer: configures traffic handling
- Panel administrator → Panel interface: manages VPN
README.md - Panel interface → Panel API client: requests API
panel/frontend/src/App.tsx - Panel interface → Routing editor: edits routing
panel/frontend/src/App.tsx - Panel API client → Panel backend: calls endpoints
- Panel backend → Admin authentication: routes authentication
panel/backend/src/main.rs - Panel backend → Inbounds and clients: routes client management
panel/backend/src/main.rs - Panel backend → Client keys: routes key management
panel/backend/src/main.rs - Panel backend → Subscriptions: routes subscriptions
panel/backend/src/main.rs - Panel backend → Routing rules: routes policy
panel/backend/src/main.rs - Panel backend → Traffic statistics: routes traffic reports
panel/backend/src/main.rs - Panel backend → SQLite database: stores panel state
panel/backend/src/main.rs - Client keys → Profiles and imports: emits import config
- Subscription import → Subscriptions: retrieves subscription