LME.Uaflix and LME.AnimeON) serve streams from Ashdi, a Ukrainian CDN. In restricted network environments a client may not be able to reach ashdi.vip directly. The magic_apn option lets you specify a reverse-proxy template URL; the module rewrites every Ashdi stream link through that template before passing it to the player, so the player only ever contacts your proxy host.
How it works
When the module detects a stream URL containingashdi.vip, it passes the original URL through the template defined in magic_apn.ashdi. The template contains a placeholder ({encodeurl}, {encode_uri}, or {uri}) that is replaced with the Ashdi URL before the link is sent to the player.
Non-Ashdi streams are not affected by magic_apn.
Configuration example
init.conf
A reverse-proxy template URL for Ashdi streams. Must contain one of the supported placeholders (
{encodeurl}, {encode_uri}, or {uri}). If the value is empty or null, Ashdi stream rewriting is disabled. The default value used when this field is omitted is "https://tut.im/proxy.php?url={encodeurl}".URL template placeholders
TheBuildUrl method in ApnHelper.cs resolves the placeholder at runtime:
| Placeholder | Encoding | Example output |
|---|---|---|
{encodeurl} | UrlEncode (percent-encoding, spaces as %20) | https://proxy.example.com/?url=https%3A%2F%2Fashdi.vip%2F... |
{encode_uri} | Same as {encodeurl} | Identical behavior to {encodeurl} |
{uri} | No encoding — raw URL inserted as-is | https://proxy.example.com/?url=https://ashdi.vip/... |
/ separator:
The default host
https://tut.im/proxy.php?url={encodeurl} is built into the module and is applied automatically when magic_apn is present in the defaults. You only need to set magic_apn.ashdi if you want to use a different proxy endpoint.Disabling Ashdi rewriting
Setmagic_apn.ashdi to an empty string or null to turn off URL rewriting for Ashdi streams:
init.conf
Interaction with streamproxy
Choose one approach: use magic_apn to rewrite Ashdi URLs on the client, or use streamproxy to relay all streams through the Lampac server. Do not configure both.
magic_apn vs explicit apn / apn_host
The apn (boolean) and apn_host (string) fields are a lower-level interface to the same mechanism. magic_apn is the recommended shorthand:
| Field | Type | Description |
|---|---|---|
magic_apn.ashdi | string | Sets the APN host and enables APN streaming in one step. Preferred. |
apn | boolean | Explicitly enables or disables APN streaming. |
apn_host | string | Sets the proxy template URL directly, without the ashdi sub-key. |
magic_apn takes precedence for Ashdi-specific routing. The module strips magic_apn, apn, and apn_host from the loaded config after processing, so only the resolved internal state is retained.
Compatibility with other settings
magic_apn does not conflict with webcorshost. CORS is used during the parsing phase on the server, while magic_apn rewrites stream URLs returned to the client player. Both can be active simultaneously.