SagerNet is an Android VPN client that routes device traffic through proxy protocols to bypass internet censorship and access restricted content. It functions as a censorship circumvention tool, distributing anti-censorship platforms and helping users evade network restrictions, while also serving as a platform for studying internet censorship patterns through scientific research.
The application routes network traffic through proxy protocols by hooking into the Android VpnService API to create a local VPN tunnel, running persistently as a foreground service with a notification to prevent the OS from killing it. It stores and exchanges proxy profiles and routing rules as structured JSON documents, and intercepts DNS queries to resolve them through proxy tunnels, preventing DNS poisoning and leaks. Traffic is directed through different proxy chains or direct connections based on configurable domain, IP, and geo-IP rules, with per-connection byte counts and session metadata collected for real-time bandwidth monitoring and logging.
The proxy core is plugin-based, loading protocol implementations at runtime, and integrates multiple proxy transports including VMess, Shadowsocks, and Trojan through a unified V2Ray-core abstraction layer.