$ show MatinSenPai/SenPaiScanner
SenPaiScanner is a production-grade Cloudflare IP scanner with three frontendsβa Bubble Tea TUI, a Wails v2 desktop GUI, and an Android Kotlin/Compose appβall sharing a common Go core. It scans Cloudflare's IPv4 ranges to discover reachable endpoints for VLESS/Trojan/VMess proxy configurations on filtered or high-latency networks. Scans run in two phases: a fast TCP/TLS/HTTP connectivity sweep, followed by optional validation through an embedded xray-core instance that measures latency, loss, jitter, and throughput. Results can be exported as raw endpoints, rewritten share URLs, Base64 subscriptions, Sing-box JSON, and Clash YAML, with live file output during scanning.
The LLM identified 5 files worth highlighting for reuse:
Generic concurrent scanning engine with configurable worker count, rate limiting, context cancellation, and per-result callbacks. It is isolated and parameterized, so it can be reused in any connection-scanning tool without pulling in SenPai-specific business logic.
Parses VLESS, Trojan, and VMess config URLs into structured transport settings and builds xray JSON configs. Handles WebSocket paths, SNI, host, TLS flags, and custom transportsβnon-obvious parsing logic that could be extracted for any V2Ray-compatible proxy tool.
Streams Cloudflare IP ranges with random/weighted selection and expands a successful hit into nearby IPs for deeper scanning. The streaming iterator pattern is reusable for any large-range network scanner that needs bounded memory and incremental discovery.
Converts validated endpoints into multiple share formats including Base64 subscriptions, Sing-box JSON, Clash YAML, and raw/rewritten URLs. The writer abstraction is clean and reusable for any proxy config exporter needing multi-format output.
Low-level connectivity probes for TCP dial, TLS handshake, and HTTP requests, including an idle-hold TLS check to detect DPI that kills long-lived connections. Small, dependency-light probing functions that could be reused in other network diagnostics tools.