Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: add cache for direct dialer #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mzz2017
Copy link
Contributor

@mzz2017 mzz2017 commented Feb 20, 2025

背景

有一种可能的循环依赖情况:
dae 在解析节点域名的时候走了 resolv.conf,然后到了本地的 smartdns,smartdns 用国外 doh 被劫持代理到 dae,而代理需要过节点,而过节点需要解析节点域名……

改动

本次为 direct dialer 添加一个选项 WithCache,该选项开启后,会记录 direct dialer 的上次成功的 host 对应的 ip,并在因dns查询超时而失败时对相同 host 用缓存的 ip 进行重试

注:direct dialer 是 proxy dialer 的最后一层,连节点用的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant