Skip to content

Commit 489038d

Browse files
committed
4.10.0 enable cloudflare ipv6.
1 parent f155667 commit 489038d

File tree

9 files changed

+154
-11
lines changed

9 files changed

+154
-11
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616

1717
### 最新公告:
18-
2022-09-13
19-
* 新版 4.9.8,如果无法登陆请按[公告](https://github.com/XX-net/XX-Net/issues/13702)操作。
18+
2022-09-26
19+
* 新版 4.10.0,改进X-Tunnel连接性能,如果无法登陆请按[公告](https://github.com/XX-net/XX-Net/issues/13702)操作。
2020
* 免费用户可以无限流量访问google, Wikipedia 和 twitter,但部分地区(比如上海、北京)封锁严重,需要购买套餐才能连接接。
2121
* GAE 模块需要手动开启.
2222
没有绑卡无法工作, 想使用GAE模块请手动启用, 老id需要重新部署。

code/default/lib/noarch/front_base/check_ip.py

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def check_ip(self, ip, sni=None, host=None, wait_time=0):
5050

5151
if host:
5252
pass
53+
elif self.config.check_ip_subdomain:
54+
host = self.config.check_ip_subdomain + "." + ssl_sock.host
5355
elif self.config.check_ip_host:
5456
host = self.config.check_ip_host
5557
else:

code/default/lib/noarch/front_base/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def set_default(self):
5656
self.set_var("connection_max_life", 999990)
5757

5858
# check_ip
59+
self.set_var("check_ip_subdomain", "")
5960
self.set_var("check_ip_host", "")
6061
self.set_var("check_ip_path", "/")
6162
self.set_var("check_ip_accept_status", [200])

code/default/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.9.9
1+
4.10.0

code/default/x_tunnel/local/cloudflare_front/check_ip.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def check_all_ip(check_ip):
139139
# case 5: domain sni
140140

141141
# ip = "141.101.120.131"
142-
ip = "162.159.217.3"
143-
host = "v3.pc-nvme.shop"
142+
ip = "2a06:98c1:3120::1"
143+
host = "v3.half.autos"
144144
sni = host
145145

146146
args = list(sys.argv[1:])

code/default/x_tunnel/local/cloudflare_front/config.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def __init__(self, fn):
2828
self.set_var("connect_create_interval", 10)
2929

3030
# check_ip
31+
self.set_var("check_ip_subdomain", "scan1")
3132
self.set_var("check_ip_content", b"OK")
3233

3334
# connect_creator
@@ -37,9 +38,13 @@ def __init__(self, fn):
3738
self.set_var("update_domains", 1)
3839

3940
# ip_manager
40-
self.set_var("max_scan_ip_thread_num", 0)
41+
self.set_var("max_scan_ip_thread_num", 1)
4142
self.set_var("max_good_ip_num", 50)
42-
self.set_var("target_handshake_time", 50)
43+
self.set_var("target_handshake_time", 500)
4344
self.set_var("active_connect_interval", 3*60)
4445

46+
# ip source
47+
self.set_var("use_ipv6", "auto") # force_ipv4/force_ipv6/auto
48+
self.set_var("ipv6_scan_ratio", 40) # 0 - 100
49+
4550
self.load()

code/default/x_tunnel/local/cloudflare_front/front.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from front_base.openssl_wrap import SSLContext
1515
from front_base.connect_creator import ConnectCreator
1616
from front_base.ip_manager import IpManager
17-
from front_base.ip_source import Ipv4RangeSource
17+
from front_base.ip_source import Ipv4RangeSource, Ipv6PoolSource, IpCombineSource
1818
from front_base.http_dispatcher import HttpsDispatcher
1919
from front_base.connect_manager import ConnectManager
2020
from front_base.check_ip import CheckIp
@@ -46,13 +46,21 @@ def __init__(self):
4646
self.connect_creator = ConnectCreator(logger, self.config, openssl_context, self.host_manager)
4747
self.check_ip = CheckIp(xlog.null, self.config, self.connect_creator)
4848

49-
ip_source = Ipv4RangeSource(
49+
self.ipv4_source = Ipv4RangeSource(
5050
logger, self.config,
5151
os.path.join(current_path, "ip_range.txt"),
5252
os.path.join(module_data_path, "cloudflare_ip_range.txt")
5353
)
54+
self.ipv6_source = Ipv6PoolSource(
55+
logger, self.config,
56+
os.path.join(current_path, "ipv6_list.txt")
57+
)
58+
self.ip_source = IpCombineSource(
59+
logger, self.config,
60+
self.ipv4_source, self.ipv6_source
61+
)
5462
self.ip_manager = IpManager(
55-
logger, self.config, ip_source, check_local_network,
63+
logger, self.config, self.ip_source, check_local_network,
5664
self.check_ip.check_ip,
5765
os.path.join(current_path, "good_ip.txt"),
5866
os.path.join(module_data_path, "cloudflare_ip_list.txt"),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
2606:4700:130:436c:6f75:6466:6c61:7265 google.com gws 100 0 0
2+
2606:4700:3030::6815:123f google.com gws 100 0 0
3+
2606:4700:3030::6815:1488 google.com gws 100 0 0
4+
2606:4700:3030::6815:1b17 google.com gws 100 0 0
5+
2606:4700:3030::6815:2824
6+
2606:4700:3030::6815:452f
7+
2606:4700:3030::6815:54e0
8+
2606:4700:3030::6815:5a18
9+
2606:4700:3030::ac43:8917
10+
2606:4700:3030::ac43:8a7e
11+
2606:4700:3030::ac43:8da9
12+
2606:4700:3030::ac43:956f
13+
2606:4700:3030::ac43:b454
14+
2606:4700:3030::ac43:b57c
15+
2606:4700:3031::6815:18ec
16+
2606:4700:3031::6815:1ca0
17+
2606:4700:3031::6815:1d9d
18+
2606:4700:3031::6815:461b
19+
2606:4700:3031::6815:4ce
20+
2606:4700:3031::6815:572f
21+
2606:4700:3031::ac43:8ced
22+
2606:4700:3031::ac43:cc57
23+
2606:4700:3031::ac43:d27f
24+
2606:4700:3031::ac43:dd07
25+
2606:4700:3032::6815:1cb1
26+
2606:4700:3032::6815:2846
27+
2606:4700:3032::6815:57b2
28+
2606:4700:3032::6815:5af8
29+
2606:4700:3032::6815:5e8c
30+
2606:4700:3032::6815:f8d
31+
2606:4700:3032::ac43:8536
32+
2606:4700:3032::ac43:888c
33+
2606:4700:3032::ac43:930c
34+
2606:4700:3032::ac43:9b34
35+
2606:4700:3032::ac43:9ec8
36+
2606:4700:3032::ac43:c9d5
37+
2606:4700:3032::ac43:ca84
38+
2606:4700:3032::ac43:daae
39+
2606:4700:3032::ac43:dcfc
40+
2606:4700:3033::6815:1610
41+
2606:4700:3033::6815:23f3
42+
2606:4700:3033::6815:29b0
43+
2606:4700:3033::6815:2df3
44+
2606:4700:3033::6815:56fd
45+
2606:4700:3033::6815:694
46+
2606:4700:3033::6815:d26
47+
2606:4700:3033::ac43:846f
48+
2606:4700:3033::ac43:8ade
49+
2606:4700:3033::ac43:9360
50+
2606:4700:3033::ac43:a4e7
51+
2606:4700:3033::ac43:c5ab
52+
2606:4700:3033::ac43:c97b
53+
2606:4700:3034::6815:40fb
54+
2606:4700:3034::6815:429c
55+
2606:4700:3034::6815:4cde
56+
2606:4700:3034::6815:50f
57+
2606:4700:3034::6815:51c3
58+
2606:4700:3034::ac43:8d80
59+
2606:4700:3034::ac43:ac28
60+
2606:4700:3034::ac43:dd24
61+
2606:4700:3035::6815:1769
62+
2606:4700:3035::6815:18e5
63+
2606:4700:3035::6815:1b36
64+
2606:4700:3035::6815:20ec
65+
2606:4700:3035::6815:2e5a
66+
2606:4700:3035::6815:2ec5
67+
2606:4700:3035::6815:369b
68+
2606:4700:3035::6815:46cc
69+
2606:4700:3035::6815:554
70+
2606:4700:3035::6815:91f
71+
2606:4700:3035::ac43:84bb
72+
2606:4700:3035::ac43:86e6
73+
2606:4700:3035::ac43:8906
74+
2606:4700:3035::ac43:a180
75+
2606:4700:3035::ac43:a3d4
76+
2606:4700:3035::ac43:aaec
77+
2606:4700:3036::6815:21a5
78+
2606:4700:3036::6815:2fc5
79+
2606:4700:3036::6815:39a2
80+
2606:4700:3036::6815:3ea3
81+
2606:4700:3036::6815:743
82+
2606:4700:3036::ac43:8aa3
83+
2606:4700:3036::ac43:8d75
84+
2606:4700:3036::ac43:9513
85+
2606:4700:3036::ac43:a036
86+
2606:4700:3036::ac43:aa7e
87+
2606:4700:3036::ac43:af2b
88+
2606:4700:3036::ac43:bb8a
89+
2606:4700:3036::ac43:c0ef
90+
2606:4700:3037::6815:413e
91+
2606:4700:3037::6815:4cfb
92+
2606:4700:3037::6815:5902
93+
2606:4700:3037::6815:598c
94+
2606:4700:3037::6815:844
95+
2606:4700:3037::ac43:8b49
96+
2606:4700:3037::ac43:8c2c
97+
2606:4700:3037::ac43:8d32
98+
2606:4700:3037::ac43:9771
99+
2606:4700:3037::ac43:a2c5
100+
2606:4700:3037::ac43:a358
101+
2606:4700:3037::ac43:b4b4
102+
2606:4700:3037::ac43:bc4a
103+
2606:4700:3037::ac43:c5b6
104+
2620:101:9000:53::55
105+
2a06:98c1:3120::
106+
2a06:98c1:3120::1
107+
2a06:98c1:3120::2
108+
2a06:98c1:3120::3
109+
2a06:98c1:3120::5
110+
2a06:98c1:3120::6
111+
2a06:98c1:3120::7
112+
2a06:98c1:3120::9
113+
2a06:98c1:3120::c
114+
2a06:98c1:3120::d
115+
2a06:98c1:3120::e
116+
2a06:98c1:3121::
117+
2a06:98c1:3121::1
118+
2a06:98c1:3121::2
119+
2a06:98c1:3121::3
120+
2a06:98c1:3121::5
121+
2a06:98c1:3121::6
122+
2a06:98c1:3121::7
123+
2a06:98c1:3121::9
124+
2a06:98c1:3121::c
125+
2a06:98c1:3121::d
126+
2a06:98c1:3121::e

code/default/x_tunnel/local/upload_logs.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def pack_logs():
4141

4242
for root, subdirs, files in os.walk(data_path):
4343
for filename in files:
44-
if not filename.endswith(".log") and not filename.endswith(".json"):
44+
extension = filename.split(".")[-1]
45+
if extension not in ["log", "json", "txt"]:
4546
continue
4647

4748
src_file = os.path.join(root, filename)

0 commit comments

Comments
 (0)