mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Fix: force add a few CN cidr & always real ip
This commit is contained in:
parent
5f027572cf
commit
83e236184b
@ -9,8 +9,10 @@ import { appendArrayInPlace } from './lib/append-array-in-place';
|
||||
import { IPListOutput } from './lib/create-file';
|
||||
|
||||
export const getChnCidrPromise = createMemoizedPromise(async () => {
|
||||
const cidr4 = await processLineFromReadline(await fetchRemoteTextByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt'));
|
||||
const cidr6 = await processLineFromReadline(await fetchRemoteTextByLine('https://gaoyifan.github.io/china-operator-ip/china6.txt'));
|
||||
const [cidr4, cidr6] = await Promise.all([
|
||||
fetchRemoteTextByLine('https://raw.githubusercontent.com/misakaio/chnroutes2/master/chnroutes.txt').then(processLineFromReadline),
|
||||
fetchRemoteTextByLine('https://gaoyifan.github.io/china-operator-ip/china6.txt').then(processLineFromReadline)
|
||||
]);
|
||||
|
||||
appendArrayInPlace(cidr4, CN_CIDR_NOT_INCLUDED_IN_CHNROUTE);
|
||||
return [exclude(cidr4, NON_CN_CIDR_INCLUDED_IN_CHNROUTE, true), cidr6] as const;
|
||||
|
||||
@ -8,36 +8,30 @@ import { appendArrayInPlace } from './lib/append-array-in-place';
|
||||
|
||||
const HOSTNAMES = [
|
||||
// Network Detection, Captive Portal
|
||||
'msftncsi.com',
|
||||
'msftconnecttest.com',
|
||||
'*.msftncsi.com',
|
||||
'*.msftconnecttest.com',
|
||||
'network-test.debian.org',
|
||||
'detectportal.firefox.com',
|
||||
'resolver1.opendns.com',
|
||||
'*.ipv6.microsoft.com',
|
||||
// Handle SNAT conversation properly
|
||||
'*.srv.nintendo.net',
|
||||
'*.stun.playstation.net',
|
||||
'xbox.*.microsoft.com',
|
||||
'*.xboxlive.com',
|
||||
'turn.twilio.com',
|
||||
'*.turn.twilio.com',
|
||||
'stun.twilio.com',
|
||||
'*.stun.twilio.com',
|
||||
'stun.syncthing.net',
|
||||
// 'stun.syncthing.net',
|
||||
'stun.*',
|
||||
'controlplane.tailscale.com',
|
||||
// NTP
|
||||
'time.*.com', 'time.*.gov, time.*.edu.cn, time.*.apple.com', 'time?.*.com', 'ntp.*.com', 'ntp?.*.com', '*.time.edu.cn', '*.ntp.org.cn', '*.pool.ntp.org', 'time*.cloud.tencent.com',
|
||||
'time.*.com', 'time.*.gov, time.*.edu.cn, time.*.apple.com', 'time?.*.com', 'ntp.*.com', 'ntp?.*.com', '*.time.edu.cn', '*.ntp.org.cn', '*.pool.ntp.org', 'time*.cloud.tencent.com', 'ntp?.aliyun.com',
|
||||
// QQ Login
|
||||
'localhost.ptlogin2.qq.com',
|
||||
'localhost.sec.qq.com',
|
||||
'localhost.work.weixin.qq.com',
|
||||
// Microsoft Auto Discovery
|
||||
'PDC._msDCS.*.*',
|
||||
'DC._msDCS.*.*',
|
||||
'GC._msDCS.*.*',
|
||||
'*PDC._msDCS*',
|
||||
'*DC._msDCS*',
|
||||
'*GC._msDCS*',
|
||||
// Misc,
|
||||
'*.battlenet.com.cn',
|
||||
'*.blzstatic.cn',
|
||||
|
||||
@ -26,6 +26,24 @@ export const NON_CN_CIDR_INCLUDED_IN_CHNROUTE = [
|
||||
|
||||
// https://github.com/misakaio/chnroutes2/issues/46
|
||||
export const CN_CIDR_NOT_INCLUDED_IN_CHNROUTE = [
|
||||
// Baidu Public DNS
|
||||
'180.76.76.0/24',
|
||||
// Ali Public DNS
|
||||
'223.5.5.0/24',
|
||||
'223.6.6.0/24',
|
||||
// Tencent DNSPod Public DNS
|
||||
'119.29.29.0/24',
|
||||
'119.28.28.0/24',
|
||||
'120.53.53.0/24',
|
||||
'1.12.12.0/24',
|
||||
'1.12.34.0/24',
|
||||
// ByteDance Public DNS
|
||||
'180.184.1.0/24',
|
||||
'180.184.2.0/24',
|
||||
// 360 Public DNS
|
||||
'101.198.198.0/24',
|
||||
'101.198.199.0/24',
|
||||
|
||||
'211.99.96.0/19', // wy.com.cn
|
||||
|
||||
'40.72.0.0/15', // AS58593, Azure China, Shanghai
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user