1 Star 1 Fork 0

masx200 / deno-dns-over-https-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

deno-dns-over-https-server

deno-dns-over-https-server

使用方法

将需要反向代理的 dns over https 网址设定为环境变量 doh,

将需要反向代理的最小缓存时间(秒)设定为环境变量 ttl,

启动

npx -y cross-env "doh=https://dns.alidns.com/dns-query" 'ttl=180' token=token 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 记录说明

为了 dns 负载均衡,可以对 dns 记录随机排序

dns 记录默认保存在内存中,配置文件为config.ts,

数据保存方式可以使用mongodb数据库,

配置环境变量mongodb_url,mongodb_db,mongodb_collection

设置域名与地址的映射关系即可,支持多个地址

接口格式为JSONRPC 2.0

访问http://localhost:8000/dns_records使用 ddns

设置token环境变量为访问秘钥 token 即可使用 ddns

访问时需要携带token参数,例如

添加请求头Authorization:Bearer token

openapi 接口在文件deno-dns-over-https-server.openapi.json

jsonrpc 接口在文件DNSRecordsInterface.ts

可以使用客户端 deno-ddns-over-https-client 进行访问 ddns 服务

jsonrpc的调用的例子在文件夹dns_records

MIT License Copyright (c) 2024 masx200 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

deno-dns-over-https-server 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版 (6)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/masx200/deno-dns-over-https-server.git
git@gitee.com:masx200/deno-dns-over-https-server.git
masx200
deno-dns-over-https-server
deno-dns-over-https-server
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891