# Open subscription import for Obhodych Obhodych can import a compatible subscription from **any provider**. The app does not require a provider account in Obhodych. A provider hosts an HTTPS URL that returns Xray JSON or a supported share-link list. The user pastes that URL into the app. This is a client format, not an API for creating paid accounts. ## HTTP contract - URL: `https://provider.example/subscription/` (a query token is also supported). A public DNS hostname, a nonempty path and HTTPS on port 443 are required. Userinfo, URL fragments, redirects and non-HTTPS URLs are rejected. - Method: `GET`. The client sends `Accept: application/json`, a client `User-Agent`, `X-HWID`, `X-Device-OS` and `X-Device-Model`. `X-HWID` is stable for one installation and provider hostname. For an external provider it is derived separately for that hostname, so it is not the raw installation ID. - Response: HTTP 200 with a single Xray configuration object, an array of them, base64-encoded JSON, or a UTF-8/base64 list of supported share links (one per line). The response must be at most 4 MiB. For JSON, the provider must supply a valid Xray configuration. Obhodych replaces the local inbound with its packet-tunnel inbound, disables local Xray access/DNS logs, and preserves the provider's server, TLS fingerprint, routing, balancer and DNS settings. - Share-link lists support `vless://`, `vmess://`, `trojan://` and SIP002 `ss://` without plugins. VLESS and Trojan support TCP, WebSocket, gRPC and XHTTP, including TLS and Reality parameters in the link. VMess supports its common base64 JSON link with TCP, WebSocket, gRPC or XHTTP and TLS. Unknown protocols and unsupported transports are skipped; if no usable route remains, import fails. Do not advertise a working route without testing its actual transport on a device. A share link supplies its own outbound settings; it cannot carry the full routing, balancer or DNS policy of a complete Xray JSON configuration. - Optional usage header: `subscription-userinfo: upload=; download=; total=; expire=`. The numbers are nonnegative. `total=0` means unlimited; omit the header when usage is unavailable. This is the only usage/expiry metadata the generic client reads from a provider. - Successful JSON parsing requires at least one outbound using VLESS, VMess, Trojan, Shadowsocks or WireGuard with a nonempty `settings.vnext[].address` or `settings.servers[].address`. Unknown extra JSON fields are preserved for Xray. Clash YAML, sing-box JSON, SIP002 plugin transports and Hysteria links are **not** accepted by this version; providers can expose Xray JSON instead. See [example.json](example.json) for a structural example. The example hostname and UUID are placeholders and do not provide a working connection. A provider must generate valid credentials, endpoints and transport settings for its users. The [OpenAPI file](openapi.yaml) describes the endpoint for API tooling. ## Provider scope and privacy The app fetches an external URL directly. It does not send that URL to the Obhodych account, support, TV pairing, backup or notification services. Those features appear only for Obhodych subscriptions. The external provider receives the URL, request IP, platform fields and its own `X-HWID`; its configured servers and DNS resolvers process routed traffic under that provider's policy. The user can remove the link and encrypted local cache in the app, but must contact the provider about server-side account or log deletion. There is no Obhodych account/profile REST API for third-party providers to implement. The generic profile shows the provider hostname, local route list, and usage/expiry only when the optional header supplies it. Providers can publish their own support and account pages independently. ## Testing Serve a provider-generated JSON response over a public HTTPS endpoint, then import that URL in Obhodych on a physical iPhone. Check that routes appear, connect, switch and reconnect. The fixture here checks the parser contract; it does not prove that a remote server is reachable from a user's network.