Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/masx200/doh-cache-deno-deploy
doh-cache-deno-deploy
https://github.com/masx200/doh-cache-deno-deploy
Last synced: 6 days ago
JSON representation
doh-cache-deno-deploy
- Host: GitHub
- URL: https://github.com/masx200/doh-cache-deno-deploy
- Owner: masx200
- License: mit
- Created: 2024-01-21T13:58:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T02:00:10.000Z (15 days ago)
- Last Synced: 2024-10-31T03:16:23.079Z (15 days ago)
- Language: TypeScript
- Size: 244 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# doh-cache-deno-deploy
doh-cache-deno-deploy
### 使用方法
将需要反向代理的 dns over https 网址设定为环境变量 `doh`,
将需要反向代理的最小缓存时间(秒)设定为环境变量 `ttl`,
启动
```
npx -y cross-env "doh=https://dns.alidns.com/dns-query" 'ttl=180' deno run --unstable -A ./main.tsx
```访问`http://localhost:8000/dns-query`使用 dns over https
也可以设置`doh`环境变量为一个`json`数组 ,使用负载均衡
例如设置 `doh`为
`["https://doh.pub/dns-query","https://security.cloudflare-dns.com/dns-query"]`添加了负载均衡的故障转移功能和校验dns数据包格式的功能
设置doh服务的路径通过环境变量`DOH_PATHNAME`为 "/dns-query"
把dns请求的post方法的形式转换为get方法形式,可以方便cdn缓存优化