Map

Happ Subscription Converter

Wiki summaryvpnvlessproxyphp โ†ณ show in map Markdown
title
Happ Subscription Converter
type
summary
summary
PHP scripts emulating Happ VPN client to extract VLESS lists and bypass HWID-based device limits
tags
vpn, vless, proxy, php
created
2026-04-09
updated
2026-04-09

bubasik's gist is a two-file PHP setup plus Russian-language documentation for extracting the raw VLESS server list out of a Happ VPN subscription and re-serving it in the standard base64 VLESS subscription format that V2RayN, V2RayA, Clash, and SingBox consume natively.

The problem it solves: Happ subscriptions don't return a portable VLESS list to arbitrary HTTP clients. If you hit the subscription URL with curl or paste it into V2RayN, you don't get what the Happ app gets. The server returns different payloads depending on headers โ€” user-agent, HWID, and a few proprietary fields. Without those headers, the list is either empty, stripped, or encoded in a way the standard clients don't understand. The Happ app is also closed-source and only runs on Android/iOS, so users who want to use their own subscription on desktop, on a router, or on more than N devices have no supported path.

The gist's approach is straightforward emulation. A small PHP script (happ_converter.php) impersonates the real Happ client: it forwards requests to the upstream subscription URL while spoofing the User-Agent, the custom Happ headers, and an HWID. The upstream responds with the full list. The script then base64-decodes it, optionally caches it for three hours to keep request volume down, and re-emits it as a plain VLESS subscription. Any standard client can treat the PHP URL as its subscription source.

The interesting bit is how you find out which headers to spoof. A second script, debug_headers.php, is a generic HTTP dumper โ€” it logs every incoming request's method, URI, headers, and body to requests.log. The setup procedure is: point the real Happ mobile app at your own debug_headers.php endpoint as its subscription URL, let it hit once, read the log, copy the exact headers out, and paste them into happ_converter.php. No reverse engineering the APK, no mitmproxy, no TLS interception on the phone. The app willingly hands you its fingerprint the moment you tell it the subscription lives at your URL.

The second half of the gist is about running the same subscription on more devices than the provider's nominal limit allows. Happ's device accounting is HWID-based โ€” each unique HWID counts as one device. The converter script accepts hwid and ip as query parameters and forwards them upstream. By using a different hwid per consuming client (one for the laptop, one for the router, one for a friend), each appears as a separate device. The three-hour cache is load-bearing here: if every client hits the script on every subscription refresh, the upstream sees traffic volume that doesn't match a real user and may flag the account. Caching smooths that out.

The ops notes in the documentation cover .htaccess protection so the converter endpoint isn't world-readable (it contains the upstream URL and spoofed headers, which is effectively the subscription secret), plus integration pointers for V2RayN, V2RayA, Clash, and SingBox. All four consume the base64 VLESS subscription format identically, so once the converter works with one, it works with all.

The technique generalizes beyond Happ. Any closed-source subscription client that returns client-specific payloads can be emulated this way: log the headers the real app sends, replay them from a server, re-emit the response. Happ is the concrete case because it's popular in the RU VPN market and because its subscription endpoint does meaningful client discrimination. For broader context on VLESS and why subscriptions work this way, see xray-tutorial.

Related tooling already in the wiki: 3x-ui is the server-side counterpart โ€” it's a web panel for running the VLESS servers that a Happ subscription points at. mihomo is one of the clients that can consume the converter's output. russia-v2ray-rules-dat supplies routing rules for clients once they have a working subscription.