mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Support Clash Fake IP Filter Ruleset
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { DOMESTICS } from '../Source/non_ip/domestic';
|
import { DOMESTICS } from '../Source/non_ip/domestic';
|
||||||
import { DIRECTS, LANS } from '../Source/non_ip/direct';
|
import { DIRECTS } from '../Source/non_ip/direct';
|
||||||
import { readFileIntoProcessedArray } from './lib/fetch-text-by-line';
|
import { readFileIntoProcessedArray } from './lib/fetch-text-by-line';
|
||||||
import { compareAndWriteFile } from './lib/create-file';
|
import { compareAndWriteFile } from './lib/create-file';
|
||||||
import { task } from './trace';
|
import { task } from './trace';
|
||||||
@@ -12,21 +12,42 @@ import { appendArrayInPlace } from './lib/append-array-in-place';
|
|||||||
import { OUTPUT_INTERNAL_DIR, OUTPUT_MODULES_DIR, SOURCE_DIR } from './constants/dir';
|
import { OUTPUT_INTERNAL_DIR, OUTPUT_MODULES_DIR, SOURCE_DIR } from './constants/dir';
|
||||||
import { RulesetOutput } from './lib/create-file';
|
import { RulesetOutput } from './lib/create-file';
|
||||||
|
|
||||||
function getRule(domain: string): string[] {
|
export function createGetDnsMappingRule(allowWildcard: boolean) {
|
||||||
const results: string[] = [];
|
const hasWildcard = (domain: string) => {
|
||||||
|
if (domain.includes('*') || domain.includes('?')) {
|
||||||
|
if (!allowWildcard) {
|
||||||
|
throw new TypeError(`Wildcard domain is not supported: ${domain}`);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (domain[0] === '$' || domain[0] === '+') {
|
return false;
|
||||||
results.push(`DOMAIN-SUFFIX,${domain.slice(1)}`);
|
};
|
||||||
} else if (domain.includes('?')) {
|
|
||||||
results.push(
|
|
||||||
`DOMAIN-WILDCARD,${domain}`,
|
|
||||||
`DOMAIN-WILDCARD,*.${domain}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
results.push(`DOMAIN-SUFFIX,${domain}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
return (domain: string): string[] => {
|
||||||
|
const results: string[] = [];
|
||||||
|
if (domain[0] === '$') {
|
||||||
|
const d = domain.slice(1);
|
||||||
|
if (hasWildcard(domain)) {
|
||||||
|
results.push(`DOMAIN-WILDCARD,${d}`);
|
||||||
|
} else {
|
||||||
|
results.push(`DOMAIN,${d}`);
|
||||||
|
}
|
||||||
|
} else if (domain[0] === '+') {
|
||||||
|
const d = domain.slice(1);
|
||||||
|
if (hasWildcard(domain)) {
|
||||||
|
results.push(`DOMAIN-WILDCARD,*.${d}`);
|
||||||
|
} else {
|
||||||
|
results.push(`DOMAIN-SUFFIX,${d}`);
|
||||||
|
}
|
||||||
|
} else if (hasWildcard(domain)) {
|
||||||
|
results.push(`DOMAIN-WILDCARD,${domain}`, `DOMAIN-WILDCARD,*.${domain}`);
|
||||||
|
} else {
|
||||||
|
results.push(`DOMAIN-SUFFIX,${domain}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getDomesticAndDirectDomainsRulesetPromise = createMemoizedPromise(async () => {
|
export const getDomesticAndDirectDomainsRulesetPromise = createMemoizedPromise(async () => {
|
||||||
@@ -34,14 +55,13 @@ export const getDomesticAndDirectDomainsRulesetPromise = createMemoizedPromise(a
|
|||||||
const directs = await readFileIntoProcessedArray(path.resolve(SOURCE_DIR, 'non_ip/direct.conf'));
|
const directs = await readFileIntoProcessedArray(path.resolve(SOURCE_DIR, 'non_ip/direct.conf'));
|
||||||
const lans: string[] = [];
|
const lans: string[] = [];
|
||||||
|
|
||||||
Object.entries(DOMESTICS).forEach(([, { domains }]) => {
|
const getDnsMappingRuleWithWildcard = createGetDnsMappingRule(true);
|
||||||
appendArrayInPlace(domestics, domains.flatMap(getRule));
|
|
||||||
|
Object.values(DOMESTICS).forEach(({ domains }) => {
|
||||||
|
appendArrayInPlace(domestics, domains.flatMap(getDnsMappingRuleWithWildcard));
|
||||||
});
|
});
|
||||||
Object.entries(DIRECTS).forEach(([, { domains }]) => {
|
Object.values(DIRECTS).forEach(({ domains }) => {
|
||||||
appendArrayInPlace(directs, domains.flatMap(getRule));
|
appendArrayInPlace(directs, domains.flatMap(getDnsMappingRuleWithWildcard));
|
||||||
});
|
|
||||||
Object.entries(LANS).forEach(([, { domains }]) => {
|
|
||||||
appendArrayInPlace(lans, domains.flatMap(getRule));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return [domestics, directs, lans] as const;
|
return [domestics, directs, lans] as const;
|
||||||
@@ -50,9 +70,7 @@ export const getDomesticAndDirectDomainsRulesetPromise = createMemoizedPromise(a
|
|||||||
export const buildDomesticRuleset = task(require.main === module, __filename)(async (span) => {
|
export const buildDomesticRuleset = task(require.main === module, __filename)(async (span) => {
|
||||||
const [domestics, directs, lans] = await getDomesticAndDirectDomainsRulesetPromise();
|
const [domestics, directs, lans] = await getDomesticAndDirectDomainsRulesetPromise();
|
||||||
|
|
||||||
const dataset = Object.entries(DOMESTICS);
|
const dataset = appendArrayInPlace(Object.values(DOMESTICS), Object.values(DIRECTS));
|
||||||
appendArrayInPlace(dataset, Object.entries(DIRECTS));
|
|
||||||
appendArrayInPlace(dataset, Object.entries(LANS));
|
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
new RulesetOutput(span, 'domestic', 'non_ip')
|
new RulesetOutput(span, 'domestic', 'non_ip')
|
||||||
@@ -89,7 +107,7 @@ export const buildDomesticRuleset = task(require.main === module, __filename)(as
|
|||||||
`#!desc=Last Updated: ${new Date().toISOString()}`,
|
`#!desc=Last Updated: ${new Date().toISOString()}`,
|
||||||
'',
|
'',
|
||||||
'[Host]',
|
'[Host]',
|
||||||
...dataset.flatMap(([, { domains, dns, hosts }]) => [
|
...dataset.flatMap(({ domains, dns, hosts }) => [
|
||||||
...Object.entries(hosts).flatMap(([dns, ips]: [dns: string, ips: string[]]) => `${dns} = ${ips.join(', ')}`),
|
...Object.entries(hosts).flatMap(([dns, ips]: [dns: string, ips: string[]]) => `${dns} = ${ips.join(', ')}`),
|
||||||
...domains.flatMap((domain) => {
|
...domains.flatMap((domain) => {
|
||||||
if (domain[0] === '$') {
|
if (domain[0] === '$') {
|
||||||
@@ -114,44 +132,35 @@ export const buildDomesticRuleset = task(require.main === module, __filename)(as
|
|||||||
compareAndWriteFile(
|
compareAndWriteFile(
|
||||||
span,
|
span,
|
||||||
yaml.stringify(
|
yaml.stringify(
|
||||||
{
|
dataset.reduce<{
|
||||||
dns: {
|
dns: { 'nameserver-policy': Record<string, string | string[]> },
|
||||||
'nameserver-policy': dataset.reduce<Record<string, string | string[]>>(
|
hosts: Record<string, string>
|
||||||
(acc, [, { domains, dns }]) => {
|
}>((acc, cur) => {
|
||||||
domains.forEach((domain) => {
|
const { domains, dns, ...rest } = cur;
|
||||||
let domainWildcard = domain;
|
domains.forEach((domain) => {
|
||||||
if (domain[0] === '$') {
|
let domainWildcard = domain;
|
||||||
domainWildcard = domain.slice(1);
|
if (domain[0] === '$') {
|
||||||
} else if (domain[0] === '+') {
|
domainWildcard = domain.slice(1);
|
||||||
domainWildcard = `*.${domain.slice(1)}`;
|
} else if (domain[0] === '+') {
|
||||||
} else {
|
domainWildcard = `*.${domain.slice(1)}`;
|
||||||
domainWildcard = `+.${domain}`;
|
} else {
|
||||||
}
|
domainWildcard = `+.${domain}`;
|
||||||
|
}
|
||||||
|
|
||||||
acc[domainWildcard] = dns === 'system'
|
acc.dns['nameserver-policy'][domainWildcard] = dns === 'system'
|
||||||
? [
|
? ['system://', 'system', 'dhcp://system']
|
||||||
'system://',
|
: dns;
|
||||||
'system',
|
});
|
||||||
'dhcp://system'
|
|
||||||
]
|
|
||||||
: dns;
|
|
||||||
});
|
|
||||||
|
|
||||||
return acc;
|
if ('hosts' in rest) {
|
||||||
},
|
Object.assign(acc.hosts, rest.hosts);
|
||||||
{}
|
}
|
||||||
)
|
|
||||||
},
|
return acc;
|
||||||
hosts: dataset.reduce<Record<string, string>>(
|
}, {
|
||||||
(acc, [, { domains, dns, ...rest }]) => {
|
dns: { 'nameserver-policy': {} },
|
||||||
if ('hosts' in rest) {
|
hosts: {}
|
||||||
Object.assign(acc, rest.hosts);
|
}),
|
||||||
}
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{ version: '1.1' }
|
{ version: '1.1' }
|
||||||
).split('\n'),
|
).split('\n'),
|
||||||
path.join(OUTPUT_INTERNAL_DIR, 'clash_nameserver_policy.yaml')
|
path.join(OUTPUT_INTERNAL_DIR, 'clash_nameserver_policy.yaml')
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { task } from './trace';
|
import { task } from './trace';
|
||||||
import { compareAndWriteFile } from './lib/create-file';
|
import { compareAndWriteFile, DomainsetOutput } from './lib/create-file';
|
||||||
import { DIRECTS, LANS } from '../Source/non_ip/direct';
|
import { DIRECTS } from '../Source/non_ip/direct';
|
||||||
|
import type { DNSMapping } from '../Source/non_ip/direct';
|
||||||
|
import { DOMESTICS } from '../Source/non_ip/domestic';
|
||||||
import * as yaml from 'yaml';
|
import * as yaml from 'yaml';
|
||||||
import { OUTPUT_INTERNAL_DIR, OUTPUT_MODULES_DIR } from './constants/dir';
|
import { OUTPUT_INTERNAL_DIR, OUTPUT_MODULES_DIR } from './constants/dir';
|
||||||
import { appendArrayInPlace } from './lib/append-array-in-place';
|
import { appendArrayInPlace } from './lib/append-array-in-place';
|
||||||
|
import { SHARED_DESCRIPTION } from './lib/constants';
|
||||||
|
import { createGetDnsMappingRule } from './build-domestic-direct-lan-ruleset-dns-mapping-module';
|
||||||
|
|
||||||
const HOSTNAMES = [
|
const HOSTNAMES = [
|
||||||
// Network Detection, Captive Portal
|
// Network Detection, Captive Portal
|
||||||
@@ -33,22 +37,31 @@ const HOSTNAMES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const buildAlwaysRealIPModule = task(require.main === module, __filename)(async (span) => {
|
export const buildAlwaysRealIPModule = task(require.main === module, __filename)(async (span) => {
|
||||||
|
const surge: string[] = [];
|
||||||
|
const clashFakeIpFilter = new DomainsetOutput(span, 'clash_fake_ip_filter')
|
||||||
|
.withTitle('Sukka\'s Ruleset - Always Real IP Plus')
|
||||||
|
.withDescription([
|
||||||
|
...SHARED_DESCRIPTION,
|
||||||
|
'',
|
||||||
|
'Clash.Meta fake-ip-filter as ruleset'
|
||||||
|
]);
|
||||||
|
|
||||||
// Intranet, Router Setup, and mant more
|
// Intranet, Router Setup, and mant more
|
||||||
const dataset = [
|
const dataset = [DIRECTS, DOMESTICS].reduce<DNSMapping[]>((acc, item) => {
|
||||||
DIRECTS.HOTSPOT_CAPTIVE_PORTAL,
|
Object.values(item).forEach((i: DNSMapping) => {
|
||||||
DIRECTS.SYSTEM,
|
if (i.realip) {
|
||||||
...Object.values(LANS)
|
acc.push(i);
|
||||||
];
|
}
|
||||||
const surge = dataset.flatMap(({ domains }) => domains.flatMap((domain) => {
|
});
|
||||||
switch (domain[0]) {
|
|
||||||
case '+':
|
return acc;
|
||||||
return [`*.${domain.slice(1)}`];
|
}, []);
|
||||||
case '$':
|
|
||||||
return [domain.slice(1)];
|
const getDnsMappingRuleWithoutWildcard = createGetDnsMappingRule(false);
|
||||||
default:
|
|
||||||
return [domain, `*.${domain}`];
|
for (const { domains } of dataset) {
|
||||||
}
|
clashFakeIpFilter.addFromRuleset(domains.flatMap(getDnsMappingRuleWithoutWildcard));
|
||||||
}));
|
}
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
compareAndWriteFile(
|
compareAndWriteFile(
|
||||||
@@ -62,6 +75,7 @@ export const buildAlwaysRealIPModule = task(require.main === module, __filename)
|
|||||||
],
|
],
|
||||||
path.resolve(OUTPUT_MODULES_DIR, 'sukka_common_always_realip.sgmodule')
|
path.resolve(OUTPUT_MODULES_DIR, 'sukka_common_always_realip.sgmodule')
|
||||||
),
|
),
|
||||||
|
clashFakeIpFilter.writeClash(),
|
||||||
compareAndWriteFile(
|
compareAndWriteFile(
|
||||||
span,
|
span,
|
||||||
yaml.stringify(
|
yaml.stringify(
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import type {
|
|||||||
Response
|
Response
|
||||||
} from 'undici';
|
} from 'undici';
|
||||||
|
|
||||||
export type UndiciResponseData = Dispatcher.ResponseData<any>;
|
export type UndiciResponseData = Dispatcher.ResponseData;
|
||||||
|
|
||||||
import CacheableLookup from 'cacheable-lookup';
|
import CacheableLookup from 'cacheable-lookup';
|
||||||
import type { LookupOptions as CacheableLookupOptions } from 'cacheable-lookup';
|
import type { LookupOptions as CacheableLookupOptions } from 'cacheable-lookup';
|
||||||
@@ -50,9 +50,9 @@ setGlobalDispatcher(agent.compose(
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorCode !== 'UND_ERR_REQ_RETRY') {
|
// if (errorCode === 'UND_ERR_REQ_RETRY') {
|
||||||
return cb(err);
|
// return cb(err);
|
||||||
}
|
// }
|
||||||
|
|
||||||
const { method, retryOptions = {} } = opts;
|
const { method, retryOptions = {} } = opts;
|
||||||
|
|
||||||
|
|||||||
@@ -65,10 +65,7 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
constructor(protected readonly span: Span, protected readonly id: string) { }
|
||||||
protected readonly span: Span,
|
|
||||||
protected readonly id: string
|
|
||||||
) { }
|
|
||||||
|
|
||||||
protected title: string | null = null;
|
protected title: string | null = null;
|
||||||
withTitle(title: string) {
|
withTitle(title: string) {
|
||||||
@@ -245,7 +242,6 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private $$preprocessed: TPreprocessed | null = null;
|
private $$preprocessed: TPreprocessed | null = null;
|
||||||
|
|
||||||
get $preprocessed() {
|
get $preprocessed() {
|
||||||
if (this.$$preprocessed === null) {
|
if (this.$$preprocessed === null) {
|
||||||
this.$$preprocessed = this.span.traceChildSync('RuleOutput#preprocess: ' + this.id, () => this.preprocess());
|
this.$$preprocessed = this.span.traceChildSync('RuleOutput#preprocess: ' + this.id, () => this.preprocess());
|
||||||
@@ -253,6 +249,24 @@ export abstract class RuleOutput<TPreprocessed = unknown> {
|
|||||||
return this.$$preprocessed;
|
return this.$$preprocessed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async writeClash(outputDir?: null | string) {
|
||||||
|
await this.done();
|
||||||
|
|
||||||
|
invariant(this.title, 'Missing title');
|
||||||
|
invariant(this.description, 'Missing description');
|
||||||
|
|
||||||
|
return compareAndWriteFile(
|
||||||
|
this.span,
|
||||||
|
withBannerArray(
|
||||||
|
this.title,
|
||||||
|
this.description,
|
||||||
|
this.date,
|
||||||
|
this.clash()
|
||||||
|
),
|
||||||
|
path.join(outputDir ?? OUTPUT_CLASH_DIR, this.type, this.id + '.txt')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
async write(): Promise<void> {
|
async write(): Promise<void> {
|
||||||
await this.done();
|
await this.done();
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ export interface DNSMapping {
|
|||||||
hosts: {
|
hosts: {
|
||||||
[domain: string]: string[]
|
[domain: string]: string[]
|
||||||
},
|
},
|
||||||
|
/** which also disallows wildcard */
|
||||||
|
realip: boolean,
|
||||||
dns: string,
|
dns: string,
|
||||||
/**
|
/**
|
||||||
* domain[0]
|
* domain[0]
|
||||||
@@ -13,10 +15,11 @@ export interface DNSMapping {
|
|||||||
domains: string[]
|
domains: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DIRECTS = {
|
export const DIRECTS: Record<string, DNSMapping> = {
|
||||||
HOTSPOT_CAPTIVE_PORTAL: {
|
HOTSPOT_CAPTIVE_PORTAL: {
|
||||||
dns: 'system',
|
dns: 'system',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'securelogin.com.cn',
|
'securelogin.com.cn',
|
||||||
'$captive.apple.com',
|
'$captive.apple.com',
|
||||||
@@ -26,6 +29,7 @@ export const DIRECTS = {
|
|||||||
ROUTER: {
|
ROUTER: {
|
||||||
dns: 'system',
|
dns: 'system',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'+home',
|
'+home',
|
||||||
// 'zte.home', // ZTE CPE
|
// 'zte.home', // ZTE CPE
|
||||||
@@ -82,6 +86,7 @@ export const DIRECTS = {
|
|||||||
SYSTEM: {
|
SYSTEM: {
|
||||||
dns: 'system',
|
dns: 'system',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: true,
|
||||||
domains: [
|
domains: [
|
||||||
'+m2m',
|
'+m2m',
|
||||||
// TailScale Magic DNS
|
// TailScale Magic DNS
|
||||||
@@ -94,17 +99,17 @@ export const DIRECTS = {
|
|||||||
'+bogon',
|
'+bogon',
|
||||||
'+_msdcs'
|
'+_msdcs'
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
} satisfies Record<string, DNSMapping>;
|
|
||||||
|
|
||||||
export const LANS = {
|
|
||||||
LAN: {
|
LAN: {
|
||||||
dns: 'system',
|
dns: 'system',
|
||||||
hosts: {},
|
hosts: {
|
||||||
|
localhost: ['127.0.0.1']
|
||||||
|
},
|
||||||
|
realip: true,
|
||||||
domains: [
|
domains: [
|
||||||
'+lan',
|
'+lan',
|
||||||
// 'amplifi.lan',
|
// 'amplifi.lan',
|
||||||
'$localhost',
|
// '$localhost',
|
||||||
'localdomain',
|
'localdomain',
|
||||||
'home.arpa',
|
'home.arpa',
|
||||||
// AS112
|
// AS112
|
||||||
@@ -113,21 +118,21 @@ export const LANS = {
|
|||||||
'17.172.in-addr.arpa',
|
'17.172.in-addr.arpa',
|
||||||
'18.172.in-addr.arpa',
|
'18.172.in-addr.arpa',
|
||||||
'19.172.in-addr.arpa',
|
'19.172.in-addr.arpa',
|
||||||
'2?.172.in-addr.arpa',
|
// '2?.172.in-addr.arpa',
|
||||||
// '20.172.in-addr.arpa',
|
'20.172.in-addr.arpa',
|
||||||
// '21.172.in-addr.arpa',
|
'21.172.in-addr.arpa',
|
||||||
// '22.172.in-addr.arpa',
|
'22.172.in-addr.arpa',
|
||||||
// '23.172.in-addr.arpa',
|
'23.172.in-addr.arpa',
|
||||||
// '24.172.in-addr.arpa',
|
'24.172.in-addr.arpa',
|
||||||
// '25.172.in-addr.arpa',
|
'25.172.in-addr.arpa',
|
||||||
// '26.172.in-addr.arpa',
|
'26.172.in-addr.arpa',
|
||||||
// '27.172.in-addr.arpa',
|
'27.172.in-addr.arpa',
|
||||||
// '28.172.in-addr.arpa',
|
'28.172.in-addr.arpa',
|
||||||
// '29.172.in-addr.arpa',
|
'29.172.in-addr.arpa',
|
||||||
'30.172.in-addr.arpa',
|
'30.172.in-addr.arpa',
|
||||||
'31.172.in-addr.arpa',
|
'31.172.in-addr.arpa',
|
||||||
'168.192.in-addr.arpa',
|
'168.192.in-addr.arpa',
|
||||||
'254.169.in-addr.arpa'
|
'254.169.in-addr.arpa'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
} satisfies Record<string, DNSMapping>;
|
};
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import type { DNSMapping } from './direct';
|
import type { DNSMapping } from './direct';
|
||||||
|
|
||||||
export const DOMESTICS = {
|
export const DOMESTICS: Record<string, DNSMapping> = {
|
||||||
ALIBABA: {
|
ALIBABA: {
|
||||||
hosts: {
|
hosts: {
|
||||||
'dns.alidns.com': ['223.5.5.5', '223.6.6.6', '2400:3200:baba::1', '2400:3200::1']
|
'dns.alidns.com': ['223.5.5.5', '223.6.6.6', '2400:3200:baba::1', '2400:3200::1']
|
||||||
},
|
},
|
||||||
dns: 'quic://dns.alidns.com:853',
|
dns: 'quic://dns.alidns.com:853',
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'uc.cn',
|
'uc.cn',
|
||||||
// 'ucweb.com', // UC International
|
// 'ucweb.com', // UC International
|
||||||
@@ -89,6 +90,7 @@ export const DOMESTICS = {
|
|||||||
'dns.pub': ['120.53.53.53', '1.12.12.12', '1.12.34.56']
|
'dns.pub': ['120.53.53.53', '1.12.12.12', '1.12.34.56']
|
||||||
},
|
},
|
||||||
dns: 'https://doh.pub/dns-query',
|
dns: 'https://doh.pub/dns-query',
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
// 'dns.pub',
|
// 'dns.pub',
|
||||||
// 'doh.pub',
|
// 'doh.pub',
|
||||||
@@ -142,6 +144,7 @@ export const DOMESTICS = {
|
|||||||
BILIBILI_ALI: {
|
BILIBILI_ALI: {
|
||||||
dns: 'quic://dns.alidns.com:853',
|
dns: 'quic://dns.alidns.com:853',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'$upos-sz-mirrorali.bilivideo.com',
|
'$upos-sz-mirrorali.bilivideo.com',
|
||||||
'$upos-sz-estgoss.bilivideo.com'
|
'$upos-sz-estgoss.bilivideo.com'
|
||||||
@@ -150,6 +153,7 @@ export const DOMESTICS = {
|
|||||||
BILIBILI_BD: {
|
BILIBILI_BD: {
|
||||||
dns: '180.76.76.76',
|
dns: '180.76.76.76',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'$upos-sz-mirrorbd.bilivideo.com',
|
'$upos-sz-mirrorbd.bilivideo.com',
|
||||||
'$upos-sz-mirrorbos.bilivideo.com'
|
'$upos-sz-mirrorbos.bilivideo.com'
|
||||||
@@ -158,6 +162,7 @@ export const DOMESTICS = {
|
|||||||
BILIBILI: {
|
BILIBILI: {
|
||||||
dns: 'https://doh.pub/dns-query',
|
dns: 'https://doh.pub/dns-query',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'$upos-sz-mirrorcoso1.bilivideo.com',
|
'$upos-sz-mirrorcoso1.bilivideo.com',
|
||||||
'$upos-sz-mirrorcosbstar1.bilivideo.com', // Bilibili Intl with Tencent Cloud CDN
|
'$upos-sz-mirrorcosbstar1.bilivideo.com', // Bilibili Intl with Tencent Cloud CDN
|
||||||
@@ -187,6 +192,7 @@ export const DOMESTICS = {
|
|||||||
XIAOMI: {
|
XIAOMI: {
|
||||||
dns: 'https://doh.pub/dns-query',
|
dns: 'https://doh.pub/dns-query',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'mi.com',
|
'mi.com',
|
||||||
'duokan.com',
|
'duokan.com',
|
||||||
@@ -205,6 +211,7 @@ export const DOMESTICS = {
|
|||||||
BYTEDANCE: {
|
BYTEDANCE: {
|
||||||
dns: '180.184.2.2',
|
dns: '180.184.2.2',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'+bytecdn.cn',
|
'+bytecdn.cn',
|
||||||
'+toutiaoimg.com',
|
'+toutiaoimg.com',
|
||||||
@@ -251,6 +258,7 @@ export const DOMESTICS = {
|
|||||||
BAIDU: {
|
BAIDU: {
|
||||||
dns: '180.76.76.76',
|
dns: '180.76.76.76',
|
||||||
hosts: {},
|
hosts: {},
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'91.com',
|
'91.com',
|
||||||
'hao123.com',
|
'hao123.com',
|
||||||
@@ -288,6 +296,7 @@ export const DOMESTICS = {
|
|||||||
'dns.360.net': ['101.198.198.198', '101.198.199.200']
|
'dns.360.net': ['101.198.198.198', '101.198.199.200']
|
||||||
},
|
},
|
||||||
dns: 'https://dns.360.net/dns-query',
|
dns: 'https://dns.360.net/dns-query',
|
||||||
|
realip: false,
|
||||||
domains: [
|
domains: [
|
||||||
'+qhimg.com',
|
'+qhimg.com',
|
||||||
'+qhimgs.com',
|
'+qhimgs.com',
|
||||||
@@ -323,4 +332,4 @@ export const DOMESTICS = {
|
|||||||
'qiku.com'
|
'qiku.com'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
} satisfies Record<string, DNSMapping>;
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user