Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add dialer options for remote ruleset#2702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
k9982874 wants to merge41 commits intoSagerNet:dev-next
base:dev-next
Choose a base branch
Loading
fromk9982874:dev-remote-ruleset-dialer

Conversation

k9982874
Copy link
Contributor

@k9982874k9982874 commentedMar 12, 2025
edited
Loading

Remote Ruleset新增Dialer支持,允许Remote Ruleset像outbound一样覆盖default_domain_resolver的设置

起因:

一般情况下default_domain_resolver可以满足ruleset的解析,但是当使用一些内部私有地址时,在公共服务器上无法正确解析
下面是个例子,此时private-ruleset无法正确下载,因为https://example.com并不能被dns_ali正确解析

{"dns": {"servers": ["dns_ali" ]  },"route": {"default_domain_resolver": {"server":"dns_ali"    },..."rule_set": [      {"tag":"private-ruleset","type":"remote","format":"source","url":"https://example.com/something.json","download_detour":"DIRECT-OUT"      }    ]  }

解决方案:

给Remote Ruleset添加dialer支持,在进行下载Ruleset文件时,如果设置了domain_resolver将覆盖default_domain_resolver,以用户设置进行解析。行为上与outbound在配置domain_resolver时一致。
下面是个例子,此时private-ruleset将使用dns_private进行解析,而public-ruleset则继续走原有规则使用dns_ali进行解析

{"dns": {"servers": ["dns_ali","dns_private"    ]  },"route": {"default_domain_resolver": {"server":"dns_ali"    },..."rule_set": [      {"tag":"private-ruleset","type":"remote","format":"source","url":"https://example.com/something.json","detour":"PRIVATE-OUT","domain_resolver":"dns_private"      },      {"tag":"public-ruleset","type":"remote","format":"source","url":"A valid public URL",      }    ]  }

受影响的现有逻辑:

保留了download_detour字段,在detour字段为空,download_detour字段内容有效时,使用download_detour的值
在detour字段和download_detour字段内容都有效时,优先使用detour的值

为什么不直接设置default_domain_resolver为私有dns?

因为私有dns使用了sing-box作为上游解析代理的情况下,有可能形成回环

nekohasekaiand others added30 commitsMarch 11, 2025 20:20
fix typoSigned-off-by: libtry486 <89328481+libtry486@users.noreply.github.com>
Co-authored-by: anytls <anytls>
Signed-off-by: Estel <callmebedrockdigger@gmail.com>
Co-authored-by: anytls <anytls>
@nekohasekainekohasekaiforce-pushed thedev-next branch 11 times, most recently from3611dcd to36c095fCompareJune 21, 2025 11:43
@nekohasekainekohasekaiforce-pushed thedev-next branch 12 times, most recently from4492a53 to989034bCompareJuly 3, 2025 14:20
@nekohasekainekohasekaiforce-pushed thedev-next branch 7 times, most recently from8ec5593 tob3c1110CompareJuly 12, 2025 06:48
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

10 participants
@k9982874@nekohasekai@xchacha20-poly1305@anytls@alireza0@libtry486@TargetLocked@BedrockDigger@Zephyruso@Restia-Ashbell

[8]ページ先頭

©2009-2025 Movatter.jp