Skip to content

Commit

Permalink
feat(generator/client): filter svcb/https queries for proxy domains a…
Browse files Browse the repository at this point in the history
…s well
  • Loading branch information
1715173329 authored Jul 23, 2024
1 parent d404541 commit 6fa4110
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions root/etc/homeproxy/scripts/generate_client.uc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const dns_port = uci.get(uciconfig, uciinfra, 'dns_port') || '5333';

let main_node, main_udp_node, dedicated_udp_node, default_outbound, sniff_override = '1',
dns_server, dns_default_strategy, dns_default_server, dns_disable_cache, dns_disable_cache_expire,
dns_independent_cache, dns_client_subnet, direct_domain_list;
dns_independent_cache, dns_client_subnet, direct_domain_list, proxy_domain_list;

if (routing_mode !== 'custom') {
main_node = uci.get(uciconfig, ucimain, 'main_node') || 'nil';
Expand All @@ -65,6 +65,10 @@ if (routing_mode !== 'custom') {
direct_domain_list = trim(readfile(HP_DIR + '/resources/direct_list.txt'));
if (direct_domain_list)
direct_domain_list = split(direct_domain_list, /[\r\n]/);

proxy_domain_list = trim(readfile(HP_DIR + '/resources/proxy_list.txt'));
if (proxy_domain_list)
proxy_domain_list = split(proxy_domain_list, /[\r\n]/);
} else {
/* DNS settings */
dns_default_strategy = uci.get(uciconfig, ucidnssetting, 'default_strategy');
Expand Down Expand Up @@ -377,8 +381,10 @@ if (!isEmpty(main_node)) {
server: 'default-dns'
});

if (routing_mode === 'gfwlist')
/* Filter out SVCB/HTTPS queries for "exquisite" Apple devices */
if (routing_mode === 'gfwlist' || proxy_domain_list)
push(config.dns.rules, {
domain_keyword: (routing_mode !== 'gfwlist') ? proxy_domain_list : null,
query_type: [64, 65],
server: 'block-dns'
});
Expand Down

0 comments on commit 6fa4110

Please sign in to comment.