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

feat: support UDP/TCP DNS select [WIP] #34

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

cxz66666
Copy link
Collaborator

WIP 一个大致的想法,可以再斟酌下

设置了一个简单的选择策略,默认使用UDP,UDP无法使用则切换到TCP,当UDP不行、TCP行的时候,设置程序优先使用(只使用)TCP,并启动一个10分钟的定时器,定时器触发后设置程序优先使用UDP,当UDP、TCP都不行的时候,什么都不做,只是使用系统local dns

设置了一个简单的选择策略,默认使用UDP,UDP无法使用则切换到TCP,当UDP不行、TCP行的时候,设置程序优先使用(只使用)TCP,并启动一个10分钟的定时器,定时器触发后设置程序优先使用UDP,当UDP、TCP都不行的时候,什么都不做,只是使用系统local dns
@Mythologyli Mythologyli self-requested a review September 22, 2023 16:53
log.Printf("Resolve IPv4 addr failed using local DNS: " + host + ". Reject connection.")
return ctx, nil, err
} else {
return ctx, target.IP, nil
Copy link
Owner

@Mythologyli Mythologyli Sep 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现之前引入 go-socks 的时候不小心在这里产生了一个 Bug,设置为不使用 ZJU DNS 的话纯 V6 域名应该是没法工作的。合并这个提交就可以解决

Copy link
Owner

@Mythologyli Mythologyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我感觉可以合并

@cxz66666
Copy link
Collaborator Author

我感觉可以合并

那我感觉可以先合了看看,指不定哪天zju dns又抽风了

@Mythologyli Mythologyli merged commit e29553b into Mythologyli:main Sep 22, 2023
@Mythologyli
Copy link
Owner

感谢提交~

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.

2 participants