mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
feat: 域名解析支持自定义 EDNS(需新版前端)
This commit is contained in:
@@ -2,13 +2,7 @@ import $ from '@/core/app';
|
||||
import dnsPacket from 'dns-packet';
|
||||
import { Buffer } from 'buffer';
|
||||
|
||||
export async function doh({
|
||||
url,
|
||||
domain,
|
||||
type = 'A',
|
||||
timeout,
|
||||
ip = '223.6.6.6',
|
||||
}) {
|
||||
export async function doh({ url, domain, type = 'A', timeout, edns }) {
|
||||
const buf = dnsPacket.encode({
|
||||
type: 'query',
|
||||
id: 0,
|
||||
@@ -28,7 +22,7 @@ export async function doh({
|
||||
options: [
|
||||
{
|
||||
code: 'CLIENT_SUBNET',
|
||||
ip,
|
||||
ip: edns,
|
||||
sourcePrefixLength: 24,
|
||||
scopePrefixLength: 0,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user