Skip to main content
Some LME modules (including 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 containing ashdi.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
"LME.Uaflix": {
  "magic_apn": {
    "ashdi": "https://tut.im/proxy.php?url={encodeurl}"
  }
}
magic_apn.ashdi
string
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

The BuildUrl method in ApnHelper.cs resolves the placeholder at runtime:
PlaceholderEncodingExample 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-ishttps://proxy.example.com/?url=https://ashdi.vip/...
If the template contains none of the above placeholders, the Ashdi URL is appended to the host with a / separator:
https://your-proxy.example.com/https://ashdi.vip/stream/...
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

Set magic_apn.ashdi to an empty string or null to turn off URL rewriting for Ashdi streams:
init.conf
"magic_apn": {
  "ashdi": null
}

Interaction with streamproxy

magic_apn and streamproxy cannot be active at the same time. If APN is enabled (i.e., magic_apn.ashdi is a non-empty value), the module sets streamproxy to false at startup. Conversely, if streamproxy is true and magic_apn is not configured, apnstream is disabled automatically.
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:
FieldTypeDescription
magic_apn.ashdistringSets the APN host and enables APN streaming in one step. Preferred.
apnbooleanExplicitly enables or disables APN streaming.
apn_hoststringSets the proxy template URL directly, without the ashdi sub-key.
Both forms are read at startup; 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.

Build docs developers (and LLMs) love