Skip to content

Commit 3b38e71

Browse files
committed
feat: add no-resolve in ip rules (7Sageer#93)
1 parent 0daa472 commit 3b38e71

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@
6969

7070
## 📝 最近更新
7171

72-
### 2024-12-27
72+
### 2025-01-11
7373

74-
- 更新了 sing-box tun中废弃的 inet4_address 为 address
74+
- 使用代理获取规则集
7575

7676
## 🔧 项目结构
7777

docs/update-log.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# 更新日志
22

3+
## 2025-01-11
4+
5+
- 使用代理获取规则集
6+
37
## 2024-12-27
48

59
- 更新了 sing-box tun中废弃的 inet4_address 为 address

src/ClashConfigBuilder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export class ClashConfigBuilder extends BaseConfigBuilder {
8383

8484
this.config.rules = rules.flatMap(rule => {
8585
const siteRules = rule.site_rules[0] !== '' ? rule.site_rules.map(site => `GEOSITE,${site},${rule.outbound}`) : [];
86-
const ipRules = rule.ip_rules[0] !== '' ? rule.ip_rules.map(ip => `GEOIP,${ip},${rule.outbound}`) : [];
86+
const ipRules = rule.ip_rules[0] !== '' ? rule.ip_rules.map(ip => `GEOIP,${ip},${rule.outbound},no-resolve`) : [];
8787
const domainSuffixRules = rule.domain_suffix ? rule.domain_suffix.map(suffix => `DOMAIN-SUFFIX,${suffix},${rule.outbound}`) : [];
8888
const domainKeywordRules = rule.domain_keyword ? rule.domain_keyword.map(keyword => `DOMAIN-KEYWORD,${keyword},${rule.outbound}`) : [];
89-
const ipCidrRules = rule.ip_cidr ? rule.ip_cidr.map(cidr => `IP-CIDR,${cidr},${rule.outbound}`) : [];
89+
const ipCidrRules = rule.ip_cidr ? rule.ip_cidr.map(cidr => `IP-CIDR,${cidr},${rule.outbound},no-resolve`) : [];
9090
return [...siteRules, ...ipRules, ...domainSuffixRules, ...domainKeywordRules, ...ipCidrRules];
9191
});
9292

src/SurgeConfigBuilder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class SurgeConfigBuilder extends BaseConfigBuilder {
280280
// 处理 IP 规则
281281
if (rule.ip_rules[0] !== '') {
282282
rule.ip_rules.forEach(ip => {
283-
finalConfig.push(`GEOIP,${ip},${rule.outbound}`);
283+
finalConfig.push(`GEOIP,${ip},${rule.outbound},no-resolve`);
284284
});
285285
}
286286

@@ -301,7 +301,7 @@ export class SurgeConfigBuilder extends BaseConfigBuilder {
301301
// 处理 IP CIDR 规则
302302
if (rule.ip_cidr) {
303303
rule.ip_cidr.forEach(cidr => {
304-
finalConfig.push(`IP-CIDR,${cidr},${rule.outbound}`);
304+
finalConfig.push(`IP-CIDR,${cidr},${rule.outbound},no-resolve`);
305305
});
306306
}
307307
});

0 commit comments

Comments
 (0)