Skip to content

Commit

Permalink
fix: 修复 edns sourcePrefixLength
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Dec 21, 2024
1 parent 382d22e commit fcc9d04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.444",
"version": "2.14.445",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion backend/src/utils/dns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import $ from '@/core/app';
import dnsPacket from 'dns-packet';
import { Buffer } from 'buffer';
import { isIPv4 } from '@/utils';

export async function doh({ url, domain, type = 'A', timeout, edns }) {
const buf = dnsPacket.encode({
Expand All @@ -23,7 +24,7 @@ export async function doh({ url, domain, type = 'A', timeout, edns }) {
{
code: 'CLIENT_SUBNET',
ip: edns,
sourcePrefixLength: 24,
sourcePrefixLength: isIPv4(edns) ? 24 : 56,
scopePrefixLength: 0,
},
],
Expand Down

0 comments on commit fcc9d04

Please sign in to comment.