37 KiB
services.proxy-suite.proxy
Part of the proxy-suite options reference.
Options
- proxy
- enable
- autoProxy
- autostart
- backend
- dns
- ipv6
- listener
- outbounds
- routing
- selection
- selectionExclude
- singBox
- subscriptionUpdateInterval
- subscriptions
- tproxy
- tun
- urlTest
- xray
services.proxy-suite.proxy.enable
Whether to enable the local proxy.
Type: boolean
Default:
false
Example:
true
services.proxy-suite.proxy.autoProxy.enable
Probe each exit for the destinations clients dial, and route each one through the first
exit that reaches it for as long as it keeps working (proxy-ctl proxy auto probe shows a
verdict). Censor-side failures stay direct for zapret. Needs the sing-box backend, and
makes this host fetch every new destination itself.
Type: boolean
Default:
false
Example:
true
services.proxy-suite.proxy.autoProxy.exclude
Domain suffixes never probed or auto-routed.
Type: list of string
Default:
[ ]
Example:
[
"internal.example"
]
services.proxy-suite.proxy.autoProxy.interval
Time between probe runs. proxy-ctl proxy auto learn does not wait for it.
Type: string
Default:
"10m"
Example:
"30m"
services.proxy-suite.proxy.autoProxy.maxExits
Most exits probed, direct included. The first round tries one exit per network (AS), a second round the rest.
Type: positive integer, meaning >0
Default:
12
services.proxy-suite.proxy.autoProxy.probeBasePort
First loopback port of the per-exit probe listeners (one per exit, maxExits in total). They are unauthenticated even when proxy.listener.auth is set.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
18540
services.proxy-suite.proxy.autoProxy.probesPerRun
Most destinations probed per run; the rest wait in a backlog, most-dialled first.
Type: positive integer, meaning >0
Default:
200
services.proxy-suite.proxy.autoProxy.slowBelowKiBps
Also route destinations that work directly but crawl: at least 300 KiB in a 10 s sample,
never faster than this. 0 disables. Needs selection other than “first”.
Type: unsigned integer, meaning >=0
Default:
150
Example:
0
services.proxy-suite.proxy.autoProxy.ttlDays
Days a verdict stands, routed destinations included: a route is re-probed once this long
has passed. Everything is relearned when this host’s public address changes, and
proxy-ctl proxy auto learn <domain> re-probes one destination right away.
Type: positive integer, meaning >0
Default:
30
services.proxy-suite.proxy.autostart
Transparent mode started at boot, or null for neither. The mode named here must also be enabled (proxy.tun.enable or proxy.tproxy.enable).
Type: null or one of “tun”, “tproxy”
Default:
null
Example:
"tun"
services.proxy-suite.proxy.backend
Proxy backend. “hybrid” runs sing-box in front and hands XRay-only outbounds (XHTTP, ECH) to XRay.
Type: one of “sing-box”, “xray”, “hybrid”
Default:
"sing-box"
Example:
"hybrid"
services.proxy-suite.proxy.dns.clientSubnet
EDNS client subnet sent with every query, so a resolver reached through the proxy still answers with CDN nodes near this network. sing-box and hybrid backends.
Type: null or string
Default:
null
Example:
"203.0.113.0/24"
services.proxy-suite.proxy.dns.fakeIp.enable
In TUN mode (global and per-app), answer A queries from the TUN with a fake address and AAAA ones with nothing; sing-box maps the address back to the name when the connection comes. Saves a lookup per new site and no real lookup leaves for proxied names. Names that proxy.dns.singBox.rules or the direct routing lists send elsewhere keep real answers. The addresses handed out are kept in /var/lib/proxy-suite/fakeip, so they survive a restart. sing-box and hybrid backends; XRay’s TUN already uses its own fake DNS.
Type: boolean
Default:
false
services.proxy-suite.proxy.dns.fakeIp.inet4Range
Range the fake addresses come from.
Type: string
Default:
"198.18.0.0/15"
services.proxy-suite.proxy.dns.local
Resolver for direct traffic and the default domain resolver. Goes through the proxy in global TUN mode. TCP by default: plain UDP queries to well-known resolvers are often answered by the ISP’s DPI instead, which breaks blocked names routed direct to zapret.
Type: submodule
Default:
{
address = "1.1.1.1";
port = 53;
type = "tcp";
}
Example:
{
address = "1.1.1.1";
port = 853;
type = "tls";
}
services.proxy-suite.proxy.dns.local.address
Resolver address.
Type: string matching the pattern .+
Example:
"1.1.1.1"
services.proxy-suite.proxy.dns.local.port
Resolver port.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
53
services.proxy-suite.proxy.dns.local.type
DNS transport.
Type: one of “udp”, “tcp”, “tls”
Default:
"udp"
services.proxy-suite.proxy.dns.remote
Resolver used through the proxy; the DNS default when proxy.routing.default is proxy. On sing-box, names the routing sends through the proxy are always looked up here, so the ISP never sees them, and direct ones locally.
Type: submodule
Default:
{
address = "1.1.1.1";
port = 53;
type = "udp";
}
Example:
{
address = "1.1.1.1";
port = 853;
type = "tls";
}
services.proxy-suite.proxy.dns.remote.address
Resolver address.
Type: string matching the pattern .+
Example:
"1.1.1.1"
services.proxy-suite.proxy.dns.remote.port
Resolver port.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
53
services.proxy-suite.proxy.dns.remote.type
DNS transport.
Type: one of “udp”, “tcp”, “tls”
Default:
"udp"
services.proxy-suite.proxy.dns.singBox.rules
sing-box DNS rules, as sing-box JSON, checked before the generated ones. Kept when the route mode is all-proxy or all-bypass, which drop the generated ones.
Type: list of (attribute set)
Default:
[ ]
Example:
[
{
domain_suffix = [
"corp.example"
];
server = "corp";
}
]
services.proxy-suite.proxy.dns.singBox.servers
Extra sing-box DNS servers, as sing-box JSON, for proxy.dns.singBox.rules to name. The
built-in ones are local, remote, and fakeip when fakeIp is on.
Type: list of (attribute set)
Default:
[ ]
Example:
[
{
server = "10.0.0.53";
tag = "corp";
type = "udp";
}
]
services.proxy-suite.proxy.dns.strategy
Which addresses sing-box asks for. ipv4_only for an uplink without IPv6. sing-box and hybrid backends.
Type: null or one of “prefer_ipv4”, “prefer_ipv6”, “ipv4_only”, “ipv6_only”
Default:
null
Example:
"ipv4_only"
services.proxy-suite.proxy.ipv6
Carry IPv6 in the transparent modes: TProxy through a second listener on ::1, the TUNs (global and per-app) through an IPv6 address of their own. Off, TProxy leaves IPv6 alone and the TUNs block it, so apps fall back to IPv4. On an uplink without IPv6, set proxy.dns.strategy = “ipv4_only” too: a direct IPv6 destination would otherwise fail after the connection seems open, instead of falling back to IPv4.
Type: boolean
Default:
config.networking.enableIPv6
services.proxy-suite.proxy.listener.address
Bind address of the local SOCKS5/HTTP proxy. Use “0.0.0.0” only to expose it to the network.
Type: string
Default:
"127.0.0.1"
services.proxy-suite.proxy.listener.auth.password
Inline local proxy password. Ends up in the Nix store; prefer passwordFile.
Type: null or string matching the pattern [^[:space:]]+
Default:
null
Example:
"change-me"
services.proxy-suite.proxy.listener.auth.passwordFile
Runtime path to the local proxy password. With perAppRouting.proxychains it must be a single token, and it is readable by userControl.group through the proxychains config.
Type: null or string
Default:
null
Example:
"/run/secrets/proxy-suite-local-proxy-password"
services.proxy-suite.proxy.listener.auth.username
Username the local proxy requires. Set together with password or passwordFile.
Type: null or string matching the pattern [^[:space:]]+
Default:
null
Example:
"proxy-user"
services.proxy-suite.proxy.listener.port
Port of the local SOCKS5/HTTP proxy.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
1080
services.proxy-suite.proxy.outbounds
Static proxy outbounds. The proxy needs at least one outbound or subscription to start;
proxy-ctl proxy outbounds add supplies one at runtime if none is declared here.
Type: list of (submodule)
Default:
[ ]
Example:
[
{
tag = "de-vps";
urlFile = "/run/secrets/proxy-de-url";
}
{
tag = "nl-vps";
url = "hy2://password@example.com:443?sni=example.com";
}
]
services.proxy-suite.proxy.outbounds.*.backend
Backend for this outbound when both run. “auto” prefers sing-box and falls back to XRay for XRay-only transports (XHTTP, ECH).
Type: one of “auto”, “sing-box”, “xray”
Default:
"auto"
Example:
"xray"
services.proxy-suite.proxy.outbounds.*.detour
Tag of the outbound this one connects through: a proxy chain. Any outbound can be the hop,
subscription entries, warp, ssh-proxy and AmneziaWG ones included. On hybrid, an
outbound that runs on XRay can only chain through another XRay one. ShadowTLS works this
way too: a shadowtls outbound in singBoxJson, and the shadowsocks one with detour naming it.
Type: null or string
Default:
null
Example:
"ru-vps"
services.proxy-suite.proxy.outbounds.*.routing.domains
Domain suffixes to match.
Type: list of string
Default:
[ ]
Example:
[
"youtube.com"
]
services.proxy-suite.proxy.outbounds.*.routing.geoips
Geoip names to match (see geodata; the defaults are country codes only).
Type: list of string
Default:
[ ]
Example:
[
"us"
]
services.proxy-suite.proxy.outbounds.*.routing.geosites
Geosite names to match (see geodata).
Type: list of string
Default:
[ ]
Example:
[
"netflix"
]
services.proxy-suite.proxy.outbounds.*.routing.ips
IP CIDRs to match.
Type: list of string
Default:
[ ]
Example:
[
"1.1.1.0/24"
]
services.proxy-suite.proxy.outbounds.*.routing.ruleSets
Names from proxy.routing.ruleSets to match (sing-box and hybrid backends).
Type: list of string
Default:
[ ]
Example:
[
"antifilter"
]
services.proxy-suite.proxy.outbounds.*.singBoxJson
Raw sing-box outbound (sing-box backend); tag is overridden.
Type: null or (attribute set)
Default:
null
Example:
{
server = "example.com";
server_port = 443;
type = "vless";
}
services.proxy-suite.proxy.outbounds.*.tag
Outbound tag, for routing rules and selection.
Type: string
Example:
"vps-de"
services.proxy-suite.proxy.outbounds.*.url
Proxy URL. Ends up in the Nix store; prefer urlFile.
Type: null or string
Default:
null
Example:
"hy2://password@example.com:443?sni=example.com"
services.proxy-suite.proxy.outbounds.*.urlFile
Runtime path to the proxy URL.
Type: null or string
Default:
null
Example:
"/run/secrets/my-proxy-url"
services.proxy-suite.proxy.outbounds.*.xrayJson
Raw XRay outbound (XRay backend); tag is overridden.
Type: null or (attribute set)
Default:
null
Example:
{
protocol = "vless";
settings = {
address = "example.com";
};
}
services.proxy-suite.proxy.routing.block.domains
Domain suffixes blocked.
Type: list of string
Default:
[ ]
Example:
[
"ads.example.com"
]
services.proxy-suite.proxy.routing.block.geoips
Geoip names blocked.
Type: list of string
Default:
[ ]
Example:
[
"cn"
]
services.proxy-suite.proxy.routing.block.geosites
Geosite names blocked.
Type: list of string
Default:
[ ]
Example:
[
"category-ads-all"
]
services.proxy-suite.proxy.routing.block.ips
IP CIDRs blocked.
Type: list of string
Default:
[ ]
Example:
[
"203.0.113.0/24"
]
services.proxy-suite.proxy.routing.block.ruleSets
Names from ruleSets blocked.
Type: list of string
Default:
[ ]
Example:
[
"ads"
]
services.proxy-suite.proxy.routing.default
Where traffic no routing rule matches goes.
Type: one of “proxy”, “direct”
Default:
"proxy"
Example:
"direct"
services.proxy-suite.proxy.routing.direct.domains
Domain suffixes sent direct. zapret hostlists join them when zapret.directSync.enable is on.
Type: list of string
Default:
[ ]
Example:
[
"internal.example"
]
services.proxy-suite.proxy.routing.direct.geoips
Geoip names sent direct.
Type: list of string
Default:
[ ]
Example:
[
"ru"
]
services.proxy-suite.proxy.routing.direct.geosites
Geosite names sent direct.
Type: list of string
Default:
[ ]
Example:
[
"category-ru"
]
services.proxy-suite.proxy.routing.direct.ips
IP CIDRs sent direct.
Type: list of string
Default:
[ ]
Example:
[
"10.10.0.0/16"
]
services.proxy-suite.proxy.routing.direct.ruleSets
Names from ruleSets sent direct.
Type: list of string
Default:
[ ]
Example:
[
"ru-services"
]
services.proxy-suite.proxy.routing.directRu
Send geosite “category-ru” and geoip “ru” direct.
Type: boolean
Default:
true
services.proxy-suite.proxy.routing.proxy.domains
Domain suffixes sent through the proxy.
Type: list of string
Default:
[ ]
Example:
[
"youtube.com"
]
services.proxy-suite.proxy.routing.proxy.geoips
Geoip names sent through the proxy.
Type: list of string
Default:
[ ]
Example:
[
"us"
]
services.proxy-suite.proxy.routing.proxy.geosites
Geosite names sent through the proxy.
Type: list of string
Default:
[ ]
Example:
[
"netflix"
]
services.proxy-suite.proxy.routing.proxy.ips
IP CIDRs sent through the proxy.
Type: list of string
Default:
[ ]
Example:
[
"1.1.1.0/24"
]
services.proxy-suite.proxy.routing.proxy.ruleSets
Names from ruleSets sent through the proxy.
Type: list of string
Default:
[ ]
Example:
[
"antifilter"
]
services.proxy-suite.proxy.routing.ruleSetUpdateInterval
How often ruleSets are downloaded again (systemd time span).
Type: string
Default:
"1d"
Example:
"6h"
services.proxy-suite.proxy.routing.ruleSets
sing-box rule sets kept up to date at runtime, for the ruleSets of proxy, direct, block,
rules and an outbound’s routing. They are fetched every ruleSetUpdateInterval and on
proxy-ctl proxy rulesets update, and sing-box picks up a new file without a restart;
until the first fetch one matches nothing. Not for backend = “xray”.
Type: attribute set of (submodule)
Default:
{ }
Example:
{
antifilter = {
url = "https://example.com/antifilter.srs";
};
}
services.proxy-suite.proxy.routing.ruleSets.<name>.detour
Downloaded through the local proxy, or directly.
Type: one of “proxy”, “direct”
Default:
"proxy"
services.proxy-suite.proxy.routing.ruleSets.<name>.format
“binary” (.srs) or “source” (JSON). Null goes by the URL: .srs is binary.
Type: null or one of “binary”, “source”
Default:
null
services.proxy-suite.proxy.routing.ruleSets.<name>.url
Where the sing-box rule set is downloaded from.
Type: string matching the pattern https?://.+
Example:
"https://example.com/antifilter.srs"
services.proxy-suite.proxy.routing.rules
Rules checked before the proxy/direct/block lists, in order; the first match wins.
Type: list of (submodule)
Default:
[ ]
Example:
[
{
geosites = [
"netflix"
];
outbound = "vps-de";
}
{
domains = [
"internal.corp"
];
outbound = "direct";
}
]
services.proxy-suite.proxy.routing.rules.*.domains
Domain suffixes to match.
Type: list of string
Default:
[ ]
Example:
[
"youtube.com"
]
services.proxy-suite.proxy.routing.rules.*.geoips
Geoip names to match (see geodata; the defaults are country codes only).
Type: list of string
Default:
[ ]
Example:
[
"us"
]
services.proxy-suite.proxy.routing.rules.*.geosites
Geosite names to match (see geodata).
Type: list of string
Default:
[ ]
Example:
[
"netflix"
]
services.proxy-suite.proxy.routing.rules.*.ips
IP CIDRs to match.
Type: list of string
Default:
[ ]
Example:
[
"1.1.1.0/24"
]
services.proxy-suite.proxy.routing.rules.*.outbound
Outbound tag, or “proxy”, “direct”, “block”.
Type: string
Example:
"vps-de"
services.proxy-suite.proxy.routing.rules.*.ruleSets
Names from proxy.routing.ruleSets to match (sing-box and hybrid backends).
Type: list of string
Default:
[ ]
Example:
[
"antifilter"
]
services.proxy-suite.proxy.selection
How to pick among outbounds:
- “first”: one at a time - the pinned outbound, or the first available.
- “selector”: all of them, pick by hand.
- “urltest”: all of them, ranked by latency unless one is pinned.
proxy-ctl proxy pin pins an outbound in every mode, and the pin outlives a restart.
“selector” and “urltest” switch without restarting the backend (sing-box only); “first”
and XRay restart it.
Type: one of “first”, “selector”, “urltest”
Default:
"first"
Example:
"urltest"
services.proxy-suite.proxy.selectionExclude
Outbound tags selection never picks on its own: hops other outbounds chain through
(detour), or exits only routing rules name. Subscription entries, warp, ssh-proxy
and AmneziaWG tags work too. A pin still reaches them, and so does a selector switched by
hand.
Type: list of string
Default:
[ ]
Example:
[
"ru-vps"
"warp"
]
services.proxy-suite.proxy.singBox.package
sing-box package, used when backend is “sing-box” or “hybrid”.
Type: package
Default:
sing-box from proxy-suite’s own nixpkgs input
Example:
pkgs.sing-box
services.proxy-suite.proxy.singBox.clashApiPort
Loopback port of sing-box’s Clash API, which switches and tests outbounds.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
9090
services.proxy-suite.proxy.subscriptionUpdateInterval
How often subscriptions are refreshed (systemd time span).
Type: string
Default:
"1d"
Example:
"6h"
services.proxy-suite.proxy.subscriptions
Subscription URLs serving a base64 or plain list of proxy URIs. Fetched on first start,
cached under /var/lib/proxy-suite/subscriptions, refreshed by a timer. Ones added with
proxy-ctl proxy subs add live in /var/lib/proxy-suite/subscriptions.d and refresh alongside.
Type: list of (submodule)
Default:
[ ]
Example:
[
{
tag = "private";
urlFile = "/run/secrets/private-sub-url";
}
]
services.proxy-suite.proxy.subscriptions.*.detour
Tag of the outbound every entry of this subscription connects through: a proxy chain. Any outbound can be the hop,
subscription entries, warp, ssh-proxy and AmneziaWG ones included. On hybrid, an
outbound that runs on XRay can only chain through another XRay one. ShadowTLS works this
way too: a shadowtls outbound in singBoxJson, and the shadowsocks one with detour naming it.
Type: null or string
Default:
null
Example:
"ru-vps"
services.proxy-suite.proxy.subscriptions.*.tag
Unique name; prefixes the tags of its outbounds and names its cache file.
Type: string matching the pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$
Example:
"community-list"
services.proxy-suite.proxy.subscriptions.*.url
Subscription URL. Ends up in the Nix store; prefer urlFile.
Type: null or string
Default:
null
Example:
"https://example.com/sub/token123"
services.proxy-suite.proxy.subscriptions.*.urlFile
Runtime path to the subscription URL.
Type: null or string
Default:
null
Example:
"/run/secrets/proxy-subscription-url"
services.proxy-suite.proxy.tproxy.enable
Whether to enable global TProxy mode (proxy-suite-tproxy).
Type: boolean
Default:
false
Example:
true
services.proxy-suite.proxy.tproxy.fwmark
Mark of intercepted packets, routed through routeTable.
Type: signed integer
Default:
1
services.proxy-suite.proxy.tproxy.lanInterfaces
Interfaces whose forwarded TCP and UDP is taken through the proxy too: devices on them that use this host as their gateway. Turns on IP forwarding for the rest (ping, the LAN itself), which is routed as it is. Needs the nftables firewall on NixOS.
Type: list of string
Default:
[ ]
Example:
[
"br0"
]
services.proxy-suite.proxy.tproxy.localSubnets
Subnets that bypass interception (DNS excepted): your LAN, VM bridges. IPv6 CIDRs work too.
Type: list of string
Default:
[
"192.168.0.0/16"
]
Example:
[
"192.168.0.0/16"
"10.0.0.0/8"
"fd00::/8"
]
services.proxy-suite.proxy.tproxy.port
Port of the TProxy inbound.
Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
1085
services.proxy-suite.proxy.tproxy.proxyMark
Mark of the backend’s own traffic, so it is not intercepted again.
Type: signed integer
Default:
2
services.proxy-suite.proxy.tproxy.routeTable
Policy-routing table for intercepted traffic.
Type: signed integer
Default:
100
services.proxy-suite.proxy.tun.enable
Whether to enable global TUN mode (proxy-suite-tun).
Type: boolean
Default:
false
Example:
true
services.proxy-suite.proxy.tun.address
TUN interface address (CIDR).
Type: string
Default:
"172.19.0.1/30"
services.proxy-suite.proxy.tun.interface
TUN interface name.
Type: string
Default:
"singtun0"
services.proxy-suite.proxy.tun.mtu
TUN interface MTU.
Type: signed integer
Default:
1400
services.proxy-suite.proxy.urlTest.interval
How often outbounds are re-tested (Go duration).
Type: string
Default:
"3m"
Example:
"1m"
services.proxy-suite.proxy.urlTest.tolerance
Milliseconds a faster outbound must win by to replace the current one (sing-box only).
Type: signed integer
Default:
50
Example:
100
services.proxy-suite.proxy.urlTest.url
URL fetched through each outbound to rank them. Pick one blocked in your region.
Type: string
Default:
"https://www.gstatic.com/generate_204"
Example:
"https://telegram.org"
services.proxy-suite.proxy.xray.package
XRay package, used when backend is “xray” or “hybrid”.
Type: package
Default:
proxy-suite’s xray (pkgs/xray.nix)
Example:
pkgs.xray