Skip to content

[Proxy Resource] External Proxy Resources ​

This section defines external proxy server list resources, supporting loading configurations from local file paths or remote HTTP/HTTPS URLs for inclusion in [Proxy Group] policy groups.

Syntax Declaration ​

External proxy resources are declared using standard INI configuration lines:

ini
name = source, [options...]

Component breakdown:

  • name: Unique identifier for the resource, referenced by the includes option in [Proxy Group] policy groups.
  • source: Positional source address argument, which must be declared as the first parameter. Supports local relative paths, absolute paths, or remote HTTP/HTTPS URLs. If the address contains commas or equals signs, it must be enclosed in double quotes.
  • [options...]: Key-value options (key=value) for configuring update intervals and other control parameters.

Field Reference ​

  • source (Local path or HTTP/HTTPS URL, positional argument, required) Resource acquisition source, declared as the first positional parameter in the configuration line. Supports local relative paths, absolute paths, or remote HTTP/HTTPS URLs; relative paths are resolved against the directory containing the configuration profile. If the address contains commas or equals signs, it must be enclosed in double quotes.

    ini
    RemoteNodes = "https://subscribe.example.com/api/v1/client/subscribe?token=<TOKEN>"
    LocalNodes = ./nodes/local_nodes.conf
  • update-interval (Integer, unit: seconds, default 86400) Scheduled fetch and automatic refresh interval for remote resources (key-value option); defaults to 86400 seconds when unset, while setting <= 0 (such as 0 or -1) disables scheduled and background auto-updates (a missing local cache is still fetched once, and manual refreshes are unaffected).

    ini
    update-interval=86400
  • format (Enum: ring or surge, default ring) Specifies the parsing format for the external proxy resource (key-value option, case-insensitive). Defaults to ring (native Ring syntax); set to surge to enable read-only Surge proxy compatibility. Unrecognized format values or other unknown key-value options do not fail validation; the system falls back to ring and preserves the original entries.

    ini
    format=surge
  • Custom extension options (String key-value pairs, default empty string) Key-value options (key=value) other than update-interval and format are preserved verbatim in declaration order into the resource model's extension parameter string (comma-joined) for extended attributes.

Loading and Update Mechanism ​

  1. Asynchronous Download & Local Caching: Remote resources are fetched asynchronously and written to a local cache during configuration loading; upon subsequent launches, valid local cache is prioritized to avoid blocking startup.
  2. Update Failure Handling: If remote requests fail during scheduled updates or reloads, the system continues using the existing cached nodes.
  3. Dynamic Policy Group Integration: When a policy group declares includes=ResourceName, proxy servers defined in the external resource are merged into that group's candidate pool, participating in health checks and routing decisions.

Surge Proxy Compatibility ​

  • Activation: Set format=surge to enable. Supports both plain Surge proxy lists and the [Proxy] section of full Surge configurations. Remote HTTP/HTTPS fetches include a Surge identifier in the request User-Agent.
  • Scope: Provided for best-effort transition only; full support is not guaranteed. Unsupported protocols or malformed entries are safely skipped.
  • Recommendation: Use native Ring format or Sub-Store for long-term usage.

Configuration Examples ​

Basic Configuration ​

ini
[Proxy Resource]
# 1. Remote HTTP/HTTPS node resource (auto-refreshed every 24 hours)
GlobalNodes = "https://subscribe.example.com/api/v1/client/subscribe?token=<TOKEN>", update-interval=86400

# 2. Backup remote node resource (auto-refreshed every 12 hours)
BackupNodes = "https://backup.example.com/profiles/nodes.conf", update-interval=43200

# 3. Local file node resource (relative path)
LocalNodes = ./nodes/local_nodes.conf

[Proxy Group]
# Auto speed-test group referencing remote node resource
AutoTest = url-test, includes=GlobalNodes, check-interval=300, tolerance=1

# Failover group falling back to backup resource on primary failure
FallbackGroup = fallback, ProxyA, includes=BackupNodes, check-interval=60

# Manual select group including both remote and local node resources
ManualSelect = select, DIRECT, includes=[GlobalNodes, LocalNodes]