Repository navigation
Conversation
Network acceleration always pointed Android at Alibaba/Tencent DNS, which is slow outside China or behind an overseas VPN. Add engine.dnsServers (cn | cloudflare | google, default cn = unchanged behaviour) with a selector under the existing switch. Existing UI strings are unchanged, so current translation dictionaries keep matching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
「网络加速」目前固定给安卓指定阿里 / 腾讯 DNS(
223.5.5.5,119.29.29.29)。在国外使用,或主机挂着海外 VPN 时,这两个国内 DNS 反而更慢,只能关掉网络加速、退回主机 DNS。改动
engine.dnsServers:cn(默认,阿里 / 腾讯)|cloudflare(1.1.1.1 / 1.0.0.1)|google(8.8.8.8 / 8.8.4.4)。emulator.js抽出DNS_PRESETS和dnsServersFor();关闭网络加速时仍然不传-dns-server,未知取值回落到cn。test/engine-test.js增加对应用例。默认值不变,老用户行为完全一致;没有改动任何已有界面文案,正在进行的 i18n PR(#43、#134)的词典不受影响。
测试
node test/engine-test.js:26 通过,0 失败。npm test其余套件全部通过;test/auto-test.js的「打包必须带上生产依赖」一项在未修改的 main 上同样失败(本地环境原因),与本改动无关。English
Background
"Network acceleration" currently always gives Android the Alibaba / Tencent DNS servers (
223.5.5.5,119.29.29.29). Outside China, or when the host is on a foreign VPN, these servers are slower, and the only option is to turn network acceleration off and fall back to the host's DNS.Changes
engine.dnsServers:cn(default, Alibaba / Tencent) |cloudflare(1.1.1.1 / 1.0.0.1) |google(8.8.8.8 / 8.8.4.4).emulator.js:DNS_PRESETSanddnsServersFor()are split out; with network acceleration off,-dns-serveris still not passed; unknown values fall back tocn.test/engine-test.js: new test cases.The default is unchanged, so existing users see no difference. No existing UI text was changed, so the dictionaries of the open i18n PRs (#43, #134) are not affected.
Tests
node test/engine-test.js: 26 passed, 0 failed.npm testsuites pass; the "package must include production dependencies" check intest/auto-test.jsfails on unmodified main as well (local environment), unrelated to this change.