如果你是从 github 直接下载的 release,exe 同级目录下应该提供了 DragTheDomainConfigFileHere.bat。
这会使用一个我自用的配置文件,也就是同目录下的 DOMAINconfig.txt。这样可以访问更多网站,注意其对子域名敏感(子域名需要单独配置)。
对于该文件 DOMAINconfig.txt 的编辑,请往下翻。
鉴于本应用名字较长,我强烈建议您把他的名字改短一点,比如 zlib.exe。
默认接下来您已经进行了重命名。
-h打开帮助,也就是显示此文件。
-g url打开后跳转到 url,而不是默认开始页。
注意:url 必须带协议头,如:https://1919810.com。
-c [FILE]使用命令行配置文件。
如果有 [FILE],程序读取 FILE,否则程序会尝试读取同一目录下的 CMDconfig.txt。
该文件包含命令行。(通常用于开发人员)
--host-resolver-rules="MAP zh.z-library.re [2606:4700:3033::ac43:aa46]:443,MAP bu2021.xyz [2606:4700:3033::6815:3e2]:443" -origin-to-force-quic-on=zh.z-library.se:443,bu2021.xyz:443
-d根据域名进行配置,要求 IP 支持 QUIC,且能访问(一般指 ping 得通)(必须支持 QUIC)。
如果有 [FILE],程序读取 FILE,否则程序会尝试读取同一目录下的 DOMAINconfig.txt。
我们通过空行来分割多个 IP 的配置,每份配置的第一行是该 IP(支持 IPv6),接下来若干行是你的域名(不包含协议头,如 https://)。注意,该方法对域名极其敏感,子域名是不一样的域名。如 www.pixiv.net 和 pixiv.net 不一样,z-library.se 和 zh.z-library.se 不一样,请注意。
由于 -origin-to-force-quic-on 不支持通配符,所以除非你理解这个程序在干什么,不建议使用类似 *.114514.com 之类的通配符。
接下来任意多行是需要启用工具的域名,尽量不要太多,Windows 命令行的长度是有限制的。(好像是8192个字符)
这个域名有两个工具选择,QUIC 和丢弃 sni。
^。(这是因为严格上来讲丢弃 sni 是非正常做法,所以使用特殊标识)-以下是一个可行的配置:(这两个 IP 分别是 CloudFlare 的 IPv4 与 IPv6 之一,为了演示分开)。
[2606:4700:3033::ac43:aa46]
zh.z-library.se
bu2021.xyz
annas-archive.se
longlivemarxleninmaoism.online
zlib-articles.se
zh.zlib-articles.se
114.250.70.34
-www.recaptcha.net
172.64.145.17
www.pixiv.net
116.202.120.165
^www.torproject.org
-o页面将显示打开此次程序的浏览器命令行参数。
-a显示 Android 开启设置文本。
见 Android 设置帮助。
给你的浏览器(比如说 chrome.exe)传参打开即可。
比如
chrome.exe --host-resolver-rules="MAP zh.z-library.re [2606:4700:3033::ac43:aa46]:443,MAP bu2021.xyz [2606:4700:3033::6815:3e2]:443" -origin-to-force-quic-on=zh.z-library.se:443,bu2021.xyz:443 --host-rules="MAP libgen.rs 193.218.118.42,MAP zh.singlelogin.re 176.123.7.105,MAP singlelogin.re 176.123.7.105" --ignore-certificate-errors
本指南极其复杂,在决定踏上这条路前请三思!
本教程测试于 MIUI14(国内版)。
遇到类似不安全或病毒报警,请自行判断是否继续。
为了省流,我不打算配图片
(.apk),提供的是两个链接,不保证可以下载。
安全下载!否则后果自负)(其他基于 Chromium 的浏览器也可,比如 Chromium, Chrome, UngoogledChromium, Bromite,我之所以推荐 kiwi 是因为他支持扩展,这也是我自用的浏览器之一,且是最常用的浏览器)先关闭本软件,再点开本软件安装包同级目录下的 GetAndroidADBCommandLine.bat,本软件会重新打开,然后复制上面的第一行内容(以 _ 开头)
你会得到类似这样的东西:
echo "_ --host-resolver-rules=\"MAP bu2021.xyz 172.64.145.17:443,MAP annas-archive.se 172.64.145.17:443\" -origin-to-force-quic-on=bu2021.xyz:443,annas-archive.se:443 --host-rules=\"MAP libgen.rs 193.218.118.42,MAP zh.singlelogin.re 176.123.7.105,MAP singlelogin.re 176.123.7.105\" --ignore-certificate-errors" > chrome-command-line
这里提供一个 MIUI 下利用 Termux 作为终端的例子。
进入 Termux 后,是一个命令行界面。
你可以考虑换清华源,见镜像站官方帮助文档
依次执行以下命令:(如果遇到提问,直接 Enter 走默认)
apt update
apt upgrade
pkg install android-tools
其他系统(UI)请自行搜索或探索办法。
请务必连上 WIFI(其实不重要,但是 MIUI 无线调试必须连 wifi 才能开启,所以这个网慢不慢不重要,其实这个操作根本不用连网)
点开 设置
点开 我的设备
点开 全部参数于信息
快速点击 MIUI版本 五次,会看到消息框 您现在处于开发者模式!
不停点击返回回到 设置 根菜单
找到 更多设置,进入
进入 开发者选项
找到 无线调试,进入,启用
与之前开启的 Termux 窗口分屏(小窗也可以,不能切后台,重要!)
点开使用配对码配对设备
会弹出来一个报告小窗窗,上面有 WLAN配对码,是 6 个数字,记下来,比如说是 114514;还有一个 IP地址和·端口(显示在报告小窗上那个),记下来,比如说是 192.168.2.114:42257
进入 Termux,打命令并 Enter
adb pair 192.168.2.224:42257 114514
根据上一步得到数据自行修改)。然后应该会显示类似 Pair Successfully 之类的,你没看到 Error 或者 ERR 就行。
回到无线调试设置,你应该会看到一个已配对设备,继续。这次我们选在主窗口上的 IP地址和端口,记下来,比如说是 192.168.2.114:42819。
键入并 Enter
adb connect 192.168.2.114:42819
应该返回 Connected Successfully 之类的,然后无线调试窗口的已配对设备会显示已连接,连接完成。Termux 不要退出。
上一步完成后,继续键入命令并 Enter(比如说在 Termux 里)。
adb shell
cd /data/local/tmp
然后把你之前获取的那段命令键入并 Enter,比方说
echo "_ --host-resolver-rules=\"MAP bu2021.xyz 172.64.145.17:443,MAP annas-archive.se 172.64.145.17:443\" -origin-to-force-quic-on=bu2021.xyz:443,annas-archive.se:443 --host-rules=\"MAP libgen.rs 193.218.118.42,MAP zh.singlelogin.re 176.123.7.105,MAP singlelogin.re 176.123.7.105\" --ignore-certificate-errors" > chrome-command-line
接下来
echo "$(<chrome-command-line)"
会输出类似这样的内容:
_ --host-resolver-rules="MAP bu2021.xyz 172.64.145.17:443,MAP annas-archive.se 172.64.145.17:443" -origin-to-force-quic-on=bu2021.xyz:443,annas-archive.se:443 --host-rules="MAP libgen.rs 193.218.118.42,MAP zh.singlelogin.re 176.123.7.105,MAP singlelogin.re 176.123.7.105" --ignore-certificate-errors
OK,键入
exit
adb disconnect
关闭无线调试,关闭开发者模式,关闭 Termux。
还记得 Kiwi 吗。
进入,一路瞎点。
地址栏输入
chrome://flags/
搜索 Command,找到 Enable command line on non-rooted devices,设置为 Enabled。
退出 Kiwi,杀掉所有进程,重启手机。
重新打开 Kiwi。
地址栏输入
chrome://version/
确认命令行栏有 _ 打头,如果没有,再次杀掉所有进程,重启,不断重复知道出现 _。
使用 KiWi 浏览器,键入 https://zh.singlelogin.re
pair,直接 connect 即可)。如果你发现了有一个域名无法连接,可以尝试配置。
洁净域名 IP 查询:Whois365(非广告)
接下来,确保 ping 通这个 IP(请自行查找 ping 的方式)。
或者,如果你明确该域名使用了 cdn,可以尝试自选 ip。
以 CloudFlare 为例你可以到这里寻找一个 CloudFlareCDN 的 IP。并请确保 ping 得通。(一般可以)
由于 Whois365 有的域名查不到,也可以浏览器查。
先将 dns 换为 Cloudflare DoH,打开 Chrome 内置 DNS 查询
输入,查询即可。再将得到的 IP 丢 Whois365 里查。
这里有两种方式:QUIC 与丢弃 SNI。
一一尝试。
注意,当你跳转的时候,对域名和协议极其敏感。
注意子域名1也要。
如果还不行,那一般就是不行。
我这里收集了上述特殊情况:
- Pornhub 的 IP 是可以直连的,但是用 HostRules 实现的域前置使用了 IP 作为 sni,而这个 ip 在黑名单里。
- Odysee 的账号网址
odysee.tv使用了 Cloudfare CDN,无法域前置,但是手动关闭了 QUIC。- TorProject 的域前置实现比较魔幻,有的时候会当成 IP 直连,甚至因服务器 IP 而异。
如果出现 HTTP 协议,或者非标准端口,请采用 CMDconfig。
// from: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/components/network_session_configurator/common/network_switch_list.h
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file deliberately has no header guard, as it's inlined in a number of
// files.
// no-include-guard-because-multiply-included
// Disables the QUIC protocol.
NETWORK_SWITCH(kDisableQuic, "disable-quic")
// Disables the HTTP/2 protocol.
NETWORK_SWITCH(kDisableHttp2, "disable-http2")
// Enables Alternate-Protocol when the port is user controlled (> 1024).
NETWORK_SWITCH(kEnableUserAlternateProtocolPorts,
"enable-user-controlled-alternate-protocol-ports")
// Enables the QUIC protocol. This is a temporary testing flag.
NETWORK_SWITCH(kEnableQuic, "enable-quic")
// Ignores certificate-related errors.
NETWORK_SWITCH(kIgnoreCertificateErrors, "ignore-certificate-errors")
// Specifies a comma separated list of host-port pairs to force use of QUIC on.
NETWORK_SWITCH(kOriginToForceQuicOn, "origin-to-force-quic-on")
// Disables known-root checks for outgoing WebTransport connections.
NETWORK_SWITCH(kWebTransportDeveloperMode, "webtransport-developer-mode")
// Specifies a comma separated list of QUIC connection options to send to
// the server.
NETWORK_SWITCH(kQuicConnectionOptions, "quic-connection-options")
// Specifies a comma separated list of QUIC client connection options.
NETWORK_SWITCH(kQuicClientConnectionOptions, "quic-client-connection-options")
// Specifies the maximum length for a QUIC packet.
NETWORK_SWITCH(kQuicMaxPacketLength, "quic-max-packet-length")
// Specifies the version of QUIC to use.
NETWORK_SWITCH(kQuicVersion, "quic-version")
// Allows for forcing socket connections to http/https to use fixed ports.
NETWORK_SWITCH(kTestingFixedHttpPort, "testing-fixed-http-port")
NETWORK_SWITCH(kTestingFixedHttpsPort, "testing-fixed-https-port")
// Comma-separated list of rules that control how hostnames are mapped.
//
// For example:
// "MAP * 127.0.0.1" --> Forces all hostnames to be mapped to 127.0.0.1
// "MAP *.google.com proxy" --> Forces all google.com subdomains to be
// resolved to "proxy".
// "MAP test.com [::1]:77 --> Forces "test.com" to resolve to IPv6 loopback.
// Will also force the port of the resulting
// socket address to be 77.
// "MAP * baz, EXCLUDE www.google.com" --> Remaps everything to "baz",
// except for "www.google.com".
//
// These mappings apply to the endpoint host in a net::URLRequest (the TCP
// connect and host resolver in a direct connection, and the CONNECT in an http
// proxy connection, and the endpoint host in a SOCKS proxy connection).
//
// TODO(mmenke): Can we just remove this? host-resolver-rules is more generally
// useful.
NETWORK_SWITCH(kHostRules, "host-rules")
// Enable "greasing" HTTP/2 frame types, that is, sending frames of reserved
// types. See https://tools.ietf.org/html/draft-bishop-httpbis-grease-00 for
// more detail.
NETWORK_SWITCH(kHttp2GreaseFrameType, "http2-grease-frame-type")
// If request has no body, close the stream not by setting END_STREAM flag on
// the HEADERS frame, but by sending an empty DATA frame with END_STREAM
// afterwards. Only affects HTTP/2 request streams, not proxy or bidirectional
// streams.
NETWORK_SWITCH(kHttp2EndStreamWithDataFrame, "http2-end-stream-with-data-frame")
本文档除引用的 Chromium 源码外部分按照 GFDL 提供。
比如说,www.pixiv.net 和 pixiv.net 不一样,z-library.se 和 zh.z-library.se 不一样。 ↩