HGhub Blocks Every Private IP Except the One Your Proxy Needs
A Tauri and Rust client for a Chinese short-drama service does serious network hardening, then punches one deliberate hole for the DNS range every Clash and Surge user depends on. The hole is the point.
- HGhub denies every private IP range it can name, then allows exactly one: 198.18.0.0/15, the RFC 2544 benchmark space that Clash and Surge return for FakeIP DNS.
- The exception is not an oversight. Block it and the client breaks for the restricted-network users it was written for, so the denylist bends to the deployment reality.
- Every upstream call funnels through a single RPC endpoint, and the bearer token lives in Rust, never in the WebView, which removes a whole class of cookie and CSRF bugs.
- Cover images ship with a compile-time AES key sitting in plain source, which is obfuscation rather than secrecy, because the client must decrypt what upstream serves.
The Deliberate Hole
HGhub denies a long list of private IP ranges. Loopback, RFC 1918, CGNAT, link-local, multicast, 6to4, Teredo. Then, in the middle of that denylist, it allows one.
198.18.0.0/15. That range is RFC 2544 benchmark space. It is also what Clash and Surge hand back for every DNS query when FakeIP mode is on. Instead of resolving a real address, the proxy returns a placeholder inside that range and routes the connection itself.
Block the range and the client breaks for the exact users it was written for. Allow it and every other private range stays sealed. The source says so out loud:
// network_policy.rs, check_ip
// 仅放行 FakeIP 198.18.0.0/15
// ("only FakeIP 198.18.0.0/15 is allowed")
That single carved-out hole is the whole project in miniature. Security rules tuned to real users, not to a textbook.
A Client for Networks That Fight Back
HGhub is a Tauri 2 client for a Chinese short-drama streaming service. Rust on the native side, React 19 and TypeScript in the WebView, shipping as Windows installers, a macOS app, and an Android APK. It does not host media. It proxies the upstream JSON API, decrypts cover images, and rewrites HLS playlists so the WebView can play them.
The audience is specific: Chinese-speaking users in a restricted network environment, often behind Clash, Surge, or a TUN setup. Their browser can reach the site. Their native app cannot. That gap is the product.
The author builds under the Minireel organization and goes by WEP. HGhub is not their first attempt. An earlier closed-source product, MiniReel, had already been downloaded more than a hundred thousand times according to the author, which makes the open-source release less a debut than a re-issue with the source attached.
之前做的 MiniReel,虽然没开源,但已经有十多万下载量了。
In a forum post, the author reflected on why a project this narrow gathered attention so fast. The point is worth keeping: a simple tool that solves a shared, concrete problem travels further than a polished one nobody needs.
一个技术上不算复杂,但恰好解决了很多人共同痛点的项目,可能比一个技术复杂、打磨许久,却没有多少人真正需要的项目,更容易获得关注。
One Endpoint, No Cookies, No Tokens in the WebView
The upstream site collapses every /api/** call into a single RPC entry point: POST /api/edge/request. The body carries a method, a path, a base64 payload, and a content type, and the request rides on an Authorization: Bearer header. HGhub implements that one endpoint and fills in the path for everything else.
The WebView never holds the bearer token and never makes a raw HTTP call. Roughly 35 Tauri commands sit between the frontend and Rust, and each is a thin wrapper that crosses the boundary. Login, feed, search, likes, comments: all of them are Rust functions the frontend can only ask for.
Because there are no cookies to manage, there is no cookie jar to poison and no ambient credential a hostile page could ride on. CSRF, in the classic sense, has nothing to attach to. The token is bound to a host, too: switching lines clears the session rather than leaking a login to a new origin.
Inside the Gauntlet
Zoom out from the single exception and the rest of the policy is disciplined. Before any fetch, parse_target_with_mode rejects control characters, anything that is not HTTP or HTTPS, and URLs with embedded credentials. It refuses the Tauri internal hosts, so the fetch layer cannot be turned against the app's own protocol endpoints. In strict mode it also refuses IP literals, localhost, .local, .internal, and .home.arpa.
IPv6 is deny-by-default with narrow global-unicast exceptions. The check excludes 6to4, which can smuggle a private IPv4 address inside, along with Teredo, documentation ranges, and the usual special-purpose blocks.
The sharpest move is on DNS itself. If a resolution returns a mix of public and private addresses, the entire answer set is thrown out. That closes the gap where retry logic or Happy Eyeballs might quietly fall back to the private one. The surviving addresses are then pinned into the client, so the address that passed the check is the address that gets connected to.
| Check | Strict mode | Relaxed mode |
|---|---|---|
| IP literals | Rejected unless they pass the range policy | Allowed |
| localhost, .local, .internal, .home.arpa | Rejected | Allowed |
| Arbitrary http/https navigation | Blocked by the navigation guard | Allowed |
| Tauri internal hosts | Rejected | Rejected |
| Control characters, non-HTTP schemes, embedded credentials | Rejected | Rejected |
| Mixed private and public DNS answers | Whole answer set rejected | Whole answer set rejected |
Covers Arrive Scrambled
Cover images do not arrive as plain pictures. They come AES-128-CBC encrypted, and the client decrypts them in Rust with a key and an IV that sit in plain source as compile-time constants.
const IMG_KEY: &[u8] = b"f5d965df75336270";
const IMG_IV: &[u8] = b"97b60394abc2fbe1";
Anyone with the binary or the repo can recover both. That is not a bug the maintainer missed. It is a property of the design: the client has to decrypt what upstream serves to a plain WebView, so the key must ship to the client. Call it obfuscation, not secrecy. The code is tolerant, too. If the bytes already look like a JPEG, PNG, GIF, or WebP, it skips decryption entirely, so the app keeps working if upstream ever stops encrypting.
The rest of the media pipeline is plumbing. HLS playlists are re-addressed so every segment plays through a custom hg protocol handled in Rust, which routes around CORS and hotlink restrictions. The custom protocol checks the request origin and reflects it back rather than using a wildcard, so credentialed requests are not opened to arbitrary origins.
A Narrow Tool in a Crowded Field
The comparison is about scope, not features. HGhub is not NewPipe, LibreTube, or Grayjay. Those are broad clients that span many providers. HGhub is the opposite bet: be the best client for one service, in one specific network environment.
| Project | Scope | Platforms | Architecture | Optimizes for |
|---|---|---|---|---|
| HGhub | One service (YellowFruit dramas) | Windows, macOS, Android | Tauri 2, Rust, React 19 | A native client for restricted networks |
| Upstream web experience | The same catalog | Browser | Web app | Reach, not feel |
| NewPipe | Many video platforms | Android | Native Java/Kotlin | Breadth, no Google services |
| LibreTube | YouTube via Piped | Android | Native | Privacy |
| Grayjay | Multi-provider | Mobile, desktop | Native, provider plugins | Provider neutrality |
An architecture comparison, not an adoption one. The numbers that matter here are the ones in the design, not the ones on a star counter.
The Cost of Specificity
A focused client is more integrated and more fragile. HGhub depends on upstream endpoints that can change without notice, and its network policy has to be re-tuned every time the proxy ecosystem shifts. The FakeIP exception is a moving target, not a fixed rule.
The project also draws lines around itself. From v1.1.0 the license is PolyForm Noncommercial 1.0.0, and the README warns against a fork that adds paywall and VIP unlocks. The posture is consistent: study and personal use, not redistribution.
That is the trade. HGhub is not a general-purpose tool that happens to work for these users. It is a specific tool that works only because it was written for them, down to the one IP range nobody else would dare to allow.





