Proxy Google DoH by cloudflare workers.
可结合 https://github.com/GangZhuo/dohclient 使用。
- 注册 cloudflare 账号
- 打开 https://workers.cloudflare.com/ ,并登录
- 点击 Create a Worker 按钮
- 把 https://github.com/GangZhuo/cf-doh/blob/master/dist/cf-doh-min.js 中的内容复制替换到左侧脚本编辑框中
- 点击 Save and Deploy 按钮
- 使用浏览器浏览新部署的站点,应能显示 Hello worker! 字符
- 如需设置到 firefox 中,请在地址后边添加 /dns-query, 形成类似 https://$yourName.$yourSubDommain.workers.dev/dns-query 这样的地址 (注意: 不是 /resolve)
- Install Wrangler
Following Cloudflare Workers Quick Start .
- Generate project by below command:
wrangler generate cf-doh https://github.com/GangZhuo/cf-doh
- Change wrangler.toml file with your "name" and "account_id".
The name field in this config file, which will map to your script’s deploy name (e.g. cf-doh.mysubdomain.workers.dev).
The account_id field can be find in your dashboard page.
- Publish project by below command:
wrangler publish
After publshed, there are two APIs:
- https://$yourName.$yourSubDommain.workers.dev/dns-query
- https://$yourName.$yourSubDommain.workers.dev/resolve?
See document at Google DoH .