2023-01-28 00:50:21 +07:00
global {
2023-02-12 15:04:30 +07:00
# tproxy port to listen at. It is NOT a HTTP/SOCKS port, and is just used by eBPF program.
# In normal case, you do not need to use it.
2023-01-28 00:50:21 +07:00
tproxy_port: 12345
2023-02-12 00:06:43 +07:00
# Log level: error, warn, info, debug, trace.
2023-02-05 13:03:34 +07:00
log_level: info
2023-01-28 00:50:21 +07:00
# Node connectivity check.
2023-02-12 14:39:00 +07:00
# Host of URL should have both IPv4 and IPv6 if you have double stack in local.
2023-02-13 17:26:31 +07:00
# Considering traffic consumption, it is recommended to choose a site with anycast IP and less response.
2023-02-15 00:53:53 +07:00
tcp_check_url: 'http://keep-alv.google.com/generate_204'
2023-02-12 00:06:43 +07:00
2023-02-13 01:40:34 +07:00
# This DNS will be used to check UDP connectivity of nodes. And if dns_upstream below contains tcp, it also be used to check
2023-02-12 14:39:00 +07:00
# TCP DNS connectivity of nodes.
2023-02-13 01:40:34 +07:00
# This DNS should have both IPv4 and IPv6 if you have double stack in local.
2023-02-09 12:42:52 +07:00
udp_check_dns: 'dns.google:53'
2023-02-12 00:06:43 +07:00
2023-01-28 14:47:43 +07:00
check_interval: 30s
2023-02-12 00:06:43 +07:00
# Group will switch node only when new_latency <= old_latency - tolerance.
2023-02-09 20:16:51 +07:00
check_tolerance: 50ms
2023-01-28 00:50:21 +07:00
2023-02-09 10:40:34 +07:00
# Value can be scheme://host:port or empty string ''.
# The scheme can be tcp/udp/tcp+udp. Empty string '' indicates as-is.
# If host is a domain and has both IPv4 and IPv6 record, dae will automatically choose
# IPv4 or IPv6 to use according to group policy (such as min latency policy).
2023-02-12 00:06:43 +07:00
# Please make sure DNS traffic will go through and be forwarded by dae, which is REQUIRED for domain routing.
# The upstream DNS answer MUST NOT be polluted, so domestic public DNS is not recommended.
2023-02-11 12:34:12 +07:00
# The request to DNS upstream follows the routing defined below.
2023-02-09 10:40:34 +07:00
dns_upstream: 'tcp+udp://dns.google:53'
2023-01-28 00:50:21 +07:00
2023-02-01 11:18:19 +07:00
# The LAN interface to bind. Use it if you only want to proxy LAN instead of localhost.
# Multiple interfaces split by ",".
2023-01-30 17:13:43 +07:00
# lan_interface: docker0
2023-02-11 12:34:12 +07:00
# SNAT for incoming connection to avoid MAC learning.
# Set it true if you are NOT using dae as a transparent bridge, but will reduce forwarding
# performance for direct traffic.
2023-02-11 12:53:43 +07:00
# This option does not affect direct traffic performance of WAN.
2023-02-11 12:34:12 +07:00
lan_nat_direct: true
2023-02-11 12:53:43 +07:00
# The WAN interface to bind. Use it if you want to proxy localhost.
2023-02-04 19:53:29 +07:00
# Multiple interfaces split by ",".
2023-01-30 14:50:55 +07:00
wan_interface: wlp5s0
2023-02-12 16:17:51 +07:00
# Allow insecure TLS certificates. It is not recommended to turn it on unless you have to.
allow_insecure: false
2023-02-15 00:53:53 +07:00
2023-02-18 01:06:23 +07:00
# Optional values of dial_mode are:
2023-02-15 00:53:53 +07:00
# 1. "ip". Dial proxy using the IP from DNS directly. This allows your ipv4, ipv6 to choose the optimal path
2023-02-18 01:06:23 +07:00
# respectively, and makes the IP version requested by the application meet expectations. For example, if you
# use curl -4 ip.sb, you will request IPv4 via proxy and get a IPv4 echo. And curl -6 ip.sb will request IPv6.
# This may solve some wierd full-cone problem if your are be your node support that.
2023-02-15 00:53:53 +07:00
# 2. "domain". Dial proxy using the domain from sniffing. This will relieve DNS pollution problem to a great extent
2023-02-18 01:06:23 +07:00
# if have impure DNS environment. Generally, this mode brings faster proxy response time because proxy will
# re-resolve the domain in remote, thus get better IP result to connect. This policy does not impact routing.
# That is to say, domain rewrite will be after traffic split of routing and dae will not re-route it.
# 3. "domain+". Based on domain mode but do not check the authenticity of sniffing result. It is useful for users
# whose DNS requests do not go through dae but want faster proxy response time. Notice that, if DNS requests
# do not go through dae, dae cannot split traffic by domain.
2023-02-15 00:53:53 +07:00
dial_mode: domain
2023-01-28 00:50:21 +07:00
}
2023-02-11 12:34:12 +07:00
# Subscriptions defined here will be resolved as nodes and merged as a part of the global node pool.
# Support to give the subscription a tag, and filter nodes from a given subscription in the group section.
2023-01-28 00:50:21 +07:00
subscription {
# Add your subscription links here.
2023-02-10 10:59:40 +07:00
my_sub: 'https://www.example.com/subscription/link'
another_sub: 'https://example.com/another_sub'
'https://example.com/no_tag_link'
2023-01-28 00:50:21 +07:00
}
2023-02-11 12:34:12 +07:00
# Nodes defined here will be merged as a part of the global node pool.
2023-01-28 00:50:21 +07:00
node {
# Add your node links here.
# Support socks5, http, https, ss, ssr, vmess, vless, trojan, trojan-go
2023-01-30 17:13:43 +07:00
'socks5://localhost:1080'
2023-01-28 00:50:21 +07:00
'ss://LINK'
}
2023-02-05 12:31:21 +07:00
# Node group (outbound).
2023-01-28 00:50:21 +07:00
group {
my_group {
2023-02-11 12:34:12 +07:00
# Filter nodes from the global node pool defined by the subscription and node section above.
2023-01-31 23:02:46 +07:00
# Pass node names as input of keyword/regex filter.
filter: name(regex:'HK|SG|TW', keyword:'JP', keyword: SH) && !name(keyword:"GCP")
2023-01-28 00:50:21 +07:00
# Randomly select a node from the group for every connection.
2023-01-29 06:31:52 +07:00
# policy: random
# Select the first node from the group for every connection.
2023-02-07 20:54:57 +07:00
# policy: fixed(0)
# Select the node with min last latency from the group for every connection.
policy: min
2023-01-28 00:50:21 +07:00
}
2023-01-31 23:02:46 +07:00
group2 {
2023-02-11 12:34:12 +07:00
# Filter nodes from the global node pool defined by the subscription and node section above.
2023-01-31 23:02:46 +07:00
# Pass node names as input of keyword/regex filter.
2023-02-10 11:02:25 +07:00
filter: subtag(regex: '^my_', another_sub) && !name(keyword: 'ExpireAt:')
2023-01-31 23:02:46 +07:00
# Select the node with min average of the last 10 latencies from the group for every connection.
policy: min_avg10
}
2023-01-28 00:50:21 +07:00
}
2023-02-05 12:31:21 +07:00
# See routing.md for full examples.
2023-01-28 00:50:21 +07:00
routing {
2023-02-16 08:50:03 +07:00
pname(NetworkManager, dnsmasq, systemd-resolved) -> must_direct # Traffic of domain name server and network manager in local must be direct to avoid loop and bad network connectivity check when binding to WAN.
ip(geoip:private, 224.0.0.0/3, 'ff00::/8') -> direct # Put it in the front to prevent broadcast, multicast and other packets that should be sent to the LAN from being forwarded by the proxy.
2023-02-05 12:31:21 +07:00
# Write your rules below.
2023-01-31 23:02:46 +07:00
2023-02-09 22:38:23 +07:00
# dae arms DNS rush-answer filter so we can use dns.google regardless of DNS pollution.
2023-02-09 10:40:34 +07:00
domain(full:dns.google) && port(53) -> direct
2023-02-04 10:24:03 +07:00
2023-01-28 00:50:21 +07:00
ip(geoip:cn) -> direct
domain(geosite:cn) -> direct
2023-02-11 23:53:33 +07:00
2023-02-18 02:01:51 +07:00
fallback: my_group
2023-01-28 00:50:21 +07:00
}