Skip to content

Client with a subscription ​

A computer with a local SOCKS5/HTTP proxy: the servers come from the provider's subscription, the fastest one is chosen automatically, and in the dashboard you can switch to a direct connection. Ads from a list are dropped, the local network goes directly.

Configuration ​

yaml
inbounds:
  local:
    mixed:
      listen: 127.0.0.1:1080

outbounds:
  direct:
    direct:

subscriptions:
  provider:
    remote:
      url: https://panel.example.com/sub/abc
      update: 6h
    exclude: '(?i)expire|traffic'
    group:
      rank:
        delay:
          probe:
            interval: 5m

groups:
  proxy:
    members: [provider, direct]
    rank:
      manual:
        default: provider

rule_sets:
  ads:
    remote:
      url: https://example.org/ads.srs
      update: 24h
      via: proxy

route:
  rules:
    - match:
        rule_set: ads
      to: block
    - match:
        ip_is_private: true
      to:
        outbound: direct
  final:
    group: proxy

cache:
  path: ours-cache

admin:
  listen: 127.0.0.1:9090
  • The subscription provider becomes the outbounds provider/<server> and the group provider, which picks the server with the lowest delay. The formats the download understands (links, Clash YAML, Xray JSON) are in Subscription formats.
  • exclude removes the service "servers" that panels use to show the expiry date and the remaining traffic.
  • proxy is a manual choice between the subscription and a direct connection; with nothing chosen, the subscription. cache remembers the choice across restarts, as well as the last download of the subscription and of the rule-set: when there is no network at startup they are taken from there.
  • ads is downloaded through proxy once a day; url is any rule-set in sing-box .srs or JSON format (Rule-sets).
  • admin opens the dashboard on 127.0.0.1:9090; the address with a random login token is printed at startup (Dashboard).

Running ​

sh
ours run -c config.yaml
curl -x socks5h://127.0.0.1:1080 https://www.example.com/

In the browser or the system, set the SOCKS5 proxy 127.0.0.1:1080 (or HTTP on the same port). With socks5h, and in browsers with "DNS through the proxy", names are resolved by the server, not by the local DNS.

If the provider serves the subscription only to "its own" clients, set its User-Agent in headers (Subscriptions). To check the download without running: ours check -c config.yaml --fetch.

If something does not work, see Troubleshooting.

GPL-3.0-or-later