Skip to content

Commit a88bcf7

Browse files
author
V2RaySSR综合网
committed
feat: 重大版本更新 v2.1.0
- 合并TLS1.3、X25519、H2、SNI匹配合并为'基础条件'列 - 优化表格显示,更加简洁明了 - 修复X25519检测逻辑,使用正确的两阶段握手 - 改进证书有效性检测,包含有效期、链可信、主机名验证 - 优化代码结构,移除未使用的方法和变量 - 完善并发控制,确保线程安全 - 统一所有检测类型(单域名、多域名、CSV)的表格格式 Breaking Changes: - 表格列结构变更:TLS1.3|X25519|H2|SNI匹配 -> 基础条件 - 基础条件显示:✓表示全部满足,✗表示任意一项不满足
1 parent 79238ba commit a88bcf7

24 files changed

+1411
-1480
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,10 @@
4646
热门网站(如 apple.com、tesla.com、microsoft.com 等)由于使用人群多,容易被识别和封禁,因此不太推荐作为 Reality 协议的目标域名。
4747

4848
**结果分析:**
49-
- 所有三个域名都支持TLS 1.3、X25519、HTTP/2和SNI匹配
50-
- 握手时间都很快(10-67ms),证书有效期充足
51-
- 都使用了CDN且为热门网站,推荐度中等(***
52-
- 虽然技术指标优秀,但由于CDN和热门网站特性,推荐度有所降低
53-
49+
- 所有域名都支持TLS 1.3、X25519、HTTP/2和SNI匹配
50+
- 证书有效期充足
51+
- 部分使用了CDN且为热门网站
52+
- 部分虽然技术指标优秀,但由于CDN和热门网站特性,推荐度有所降低
5453

5554

5655
## 🚀 快速开始

RealityChecker.png

53.1 KB
Loading

file.csv

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
IP,ORIGIN,CERT_DOMAIN,CERT_ISSUER,GEO_CODE
2+
103.103.245.124,103.103.245.124,cwangrz.top,"Let's Encrypt",HK
3+
103.103.245.129,103.103.245.129,*.bozai.cc,"ZeroSSL",HK
4+
103.103.245.128,103.103.245.128,*.weiwei132.uk,"Let's Encrypt",HK
5+
103.103.245.109,103.103.245.109,styles.redditmedia.com,"Google Trust Services LLC",HK
6+
103.103.245.94,103.103.245.94,001.90009000.xyz,"Let's Encrypt",HK
7+
103.103.245.172,103.103.245.172,voll.996969.xyz,"Let's Encrypt",HK
8+
103.103.245.175,103.103.245.175,20291010.xyz,"Let's Encrypt",HK
9+
103.103.245.81,103.103.245.81,mp.gihnius.net,"Let's Encrypt",HK
10+
103.103.245.71,103.103.245.71,010.70007000.xyz,"Let's Encrypt",HK
11+
103.103.245.191,103.103.245.191,hk.zpsonic.xyz,"Let's Encrypt",HK
12+
103.103.245.58,103.103.245.58,cloudflare.net,"Let's Encrypt",HK
13+
103.103.245.205,103.103.245.205,voll.hzwel.com,"Let's Encrypt",HK
14+
103.103.245.211,103.103.245.211,CloudFlare Origin Certificate,"CloudFlare, Inc.",HK
15+
103.103.245.223,103.103.245.223,portalhk.bricksmelt.com,"Let's Encrypt",HK
16+
103.103.245.34,103.103.245.34,xindiegame.top,"Let's Encrypt",HK
17+
103.103.245.20,103.103.245.20,780228.xyz,"Let's Encrypt",HK
18+
103.103.245.245,103.103.245.245,eaglemoe.com,"Google Trust Services",HK
19+
103.103.245.9,103.103.245.9,hk.needyou.cc,"Let's Encrypt",HK
20+
103.103.245.250,103.103.245.250,5250.vrxdy8.com,"Let's Encrypt",HK
21+
103.103.245.6,103.103.245.6,cetacloud.irort.top,"ZeroSSL",HK
22+
103.103.245.252,103.103.245.252,vcmihk103.ra9.top,"Let's Encrypt",HK
23+
103.103.245.5,103.103.245.5,cmi2.xyz88.cc,"ZeroSSL",HK
24+
103.103.245.254,103.103.245.254,youcris.site,"Let's Encrypt",HK
25+
103.103.245.2,103.103.245.2,realher.us,"Let's Encrypt",HK
26+
103.103.244.144,103.103.244.144,*.douyincdn.com,"DigiCert Inc",RU
27+
103.103.244.143,103.103.244.143,*.douyincdn.com,"DigiCert Inc",RU
28+
103.103.244.142,103.103.244.142,NONE,"NONE",RU
29+
103.103.244.141,103.103.244.141,NONE,"NONE",RU
30+
103.103.244.140,103.103.244.140,NONE,"NONE",RU
31+
103.103.244.139,103.103.244.139,NONE,"NONE",RU
32+
103.103.244.138,103.103.244.138,NONE,"NONE",RU
33+
103.103.244.137,103.103.244.137,NONE,"NONE",RU
34+
103.103.244.136,103.103.244.136,NONE,"NONE",RU
35+
103.103.244.135,103.103.244.135,NONE,"NONE",RU
36+
103.103.244.134,103.103.244.134,NONE,"NONE",RU
37+
103.103.244.133,103.103.244.133,NONE,"NONE",RU
38+
103.103.244.132,103.103.244.132,NONE,"NONE",RU
39+
103.103.244.131,103.103.244.131,NONE,"NONE",RU
40+
103.103.244.130,103.103.244.130,NONE,"NONE",RU
41+
103.103.244.112,103.103.244.112,*.zga.zenlayer.net,"Let's Encrypt",RU
42+
103.103.244.111,103.103.244.111,*.zga.zenlayer.net,"Let's Encrypt",RU
43+
103.103.244.110,103.103.244.110,*.zga.zenlayer.net,"Let's Encrypt",RU
44+
103.103.244.109,103.103.244.109,*.zga.zenlayer.net,"Let's Encrypt",RU
45+
103.103.244.108,103.103.244.108,*.zga.zenlayer.net,"Let's Encrypt",RU
46+
103.103.244.107,103.103.244.107,*.zga.zenlayer.net,"Let's Encrypt",RU
47+
103.103.244.103,103.103.244.103,*.zga.zenlayer.net,"Let's Encrypt",RU
48+
103.103.244.102,103.103.244.102,*.zga.zenlayer.net,"Let's Encrypt",RU
49+
103.103.244.98,103.103.244.98,*.zga.zenlayer.net,"Let's Encrypt",RU
50+
103.103.244.94,103.103.244.94,*.zga.zenlayer.net,"Let's Encrypt",RU
51+
103.103.244.95,103.103.244.95,minio.sk-robot.com,"Amazon",RU
52+
103.103.244.92,103.103.244.92,*.zga.zenlayer.net,"Let's Encrypt",RU
53+
103.103.244.91,103.103.244.91,*.zga.zenlayer.net,"Let's Encrypt",RU
54+
103.103.244.88,103.103.244.88,*.zga.zenlayer.net,"Let's Encrypt",RU
55+
103.103.244.87,103.103.244.87,*.zga.zenlayer.net,"Let's Encrypt",RU
56+
103.103.244.78,103.103.244.78,*.zga.zenlayer.net,"Let's Encrypt",RU
57+
103.103.244.71,103.103.244.71,*.zga.zenlayer.net,"Let's Encrypt",RU
58+
103.103.244.70,103.103.244.70,*.zga.zenlayer.net,"Let's Encrypt",RU
59+
103.103.244.66,103.103.244.66,*.zga.zenlayer.net,"Let's Encrypt",RU
60+
103.103.244.30,103.103.244.30,*.ecn.zenlayer.net,"Let's Encrypt",RU
61+
103.103.244.28,103.103.244.28,*.ecn.zenlayer.net,"Let's Encrypt",RU
62+
103.103.244.29,103.103.244.29,*.ecn.zenlayer.net,"Let's Encrypt",RU
63+
103.103.244.27,103.103.244.27,*.ecn.zenlayer.net,"Let's Encrypt",RU
64+
103.103.244.6,103.103.244.6,*.ecn.zenlayer.net,"Let's Encrypt",RU
65+
103.103.244.5,103.103.244.5,*.ecn.zenlayer.net,"Let's Encrypt",RU
66+
103.103.244.4,103.103.244.4,*.bilivideo.com,"GlobalSign nv-sa",RU
67+
103.103.244.3,103.103.244.3,*.ecn.zenlayer.net,"Let's Encrypt",RU
68+
103.103.244.2,103.103.244.2,*.ecn.zenlayer.net,"Let's Encrypt",RU

internal/batch/manager.go

Lines changed: 89 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (bm *Manager) CheckDomains(ctx context.Context, domains []string) ([]*types
9696
}
9797

9898
startTime := time.Now()
99-
99+
100100
// 使用流式检测显示实时进度
101101
results, err := bm.CheckDomainsWithProgress(ctx, domains)
102102
if err != nil {
@@ -116,56 +116,64 @@ func (bm *Manager) CheckDomains(ctx context.Context, domains []string) ([]*types
116116
func (bm *Manager) CheckDomainsWithProgress(ctx context.Context, domains []string) ([]*types.DetectionResult, error) {
117117
results := make([]*types.DetectionResult, len(domains))
118118
resultChan := make(chan *ProgressResult, len(domains))
119-
119+
120120
// 启动并发检测
121121
go func() {
122122
defer close(resultChan)
123-
123+
124124
// 使用WaitGroup控制并发
125125
var wg sync.WaitGroup
126-
127-
// 动态计算合适的并发数
128-
concurrency := bm.calculateOptimalConcurrency(len(domains))
126+
127+
// 使用配置的最大并发数,提高检测效率
128+
concurrency := int(bm.config.Concurrency.MaxConcurrent) // 使用配置的并发数(默认8个)
129129
semaphore := make(chan struct{}, concurrency)
130-
131-
// 并发控制已就绪
132-
130+
133131
for i, domain := range domains {
134132
wg.Add(1)
135133
go func(index int, domain string) {
136134
defer wg.Done()
137-
135+
138136
// 获取信号量
139-
semaphore <- struct{}{}
140-
defer func() { <-semaphore }()
141-
137+
select {
138+
case semaphore <- struct{}{}:
139+
defer func() {
140+
<-semaphore
141+
}()
142+
case <-ctx.Done():
143+
return
144+
}
145+
142146
// 检测域名
143147
result, err := bm.engine.CheckDomain(ctx, domain)
144-
148+
145149
// 发送结果
146-
resultChan <- &ProgressResult{
150+
select {
151+
case resultChan <- &ProgressResult{
147152
Index: index,
148153
Domain: domain,
149154
Result: result,
150155
Error: err,
156+
}:
157+
case <-ctx.Done():
158+
return
151159
}
152160
}(i, domain)
153161
}
154-
162+
155163
wg.Wait()
156164
}()
157-
165+
158166
// 收集结果并显示进度
159167
completed := 0
160168
for completed < len(domains) {
161169
select {
162170
case progressResult := <-resultChan:
163171
results[progressResult.Index] = progressResult.Result
164172
completed++
165-
173+
166174
// 显示进度
167175
fmt.Printf("[%s] 正在检测 [%d/%d]: %s... ", time.Now().Format("15:04:05"), completed, len(domains), progressResult.Domain)
168-
176+
169177
if progressResult.Error != nil {
170178
fmt.Printf("失败 - %v\n", progressResult.Error)
171179
} else if progressResult.Result.Suitable {
@@ -182,7 +190,7 @@ func (bm *Manager) CheckDomainsWithProgress(ctx context.Context, domains []strin
182190
return nil, ctx.Err()
183191
}
184192
}
185-
193+
186194
return results, nil
187195
}
188196

@@ -252,7 +260,7 @@ func (bm *Manager) generateBatchReport(results []*types.DetectionResult, startTi
252260
// formatBatchReport 格式化批量报告
253261
func (bm *Manager) formatBatchReport(report *types.BatchReport) string {
254262
var result strings.Builder
255-
263+
256264
// 报告头部
257265
result.WriteString(fmt.Sprintf(`
258266
批量检测报告
@@ -267,34 +275,78 @@ func (bm *Manager) formatBatchReport(report *types.BatchReport) string {
267275
report.Summary.SuccessRate*100,
268276
report.Summary.SuitabilityRate*100,
269277
))
270-
278+
271279
// 分离适合和不适合的域名
272280
var suitableResults []*types.DetectionResult
273281
var unsuitableResults []*types.DetectionResult
274-
282+
var excludedResults []*types.DetectionResult // 状态码不自然的域名
283+
275284
for _, domainResult := range report.Results {
276285
if domainResult.Suitable && domainResult.Error == nil {
277286
suitableResults = append(suitableResults, domainResult)
278287
} else {
279-
unsuitableResults = append(unsuitableResults, domainResult)
288+
// 检查是否因为状态码不自然而被排除
289+
if domainResult.StatusCodeCategory == types.StatusCodeCategoryExcluded {
290+
excludedResults = append(excludedResults, domainResult)
291+
} else {
292+
unsuitableResults = append(unsuitableResults, domainResult)
293+
}
280294
}
281295
}
282-
296+
283297
// 显示适合的域名表格
284298
if len(suitableResults) > 0 {
285299
// 按星级排序:1星在最上面,5星在最下面
286300
bm.sortByRecommendationStars(suitableResults)
287-
301+
288302
result.WriteString("适合的域名:\n\n")
289303
result.WriteString(bm.tableFormatter.FormatSuitableTable(suitableResults))
290304
result.WriteString("\n")
291305
}
292-
306+
293307
// 显示不适合的域名统计
294308
if len(unsuitableResults) > 0 {
295309
result.WriteString(bm.tableFormatter.FormatUnsuitableSummary(unsuitableResults))
296310
}
297-
311+
312+
// 显示被排除的域名(状态码不自然)
313+
if len(excludedResults) > 0 {
314+
result.WriteString("\n")
315+
result.WriteString(bm.formatExcludedDomains(excludedResults))
316+
}
317+
318+
return result.String()
319+
}
320+
321+
// formatExcludedDomains 格式化被排除的域名(状态码不自然)
322+
func (bm *Manager) formatExcludedDomains(excludedResults []*types.DetectionResult) string {
323+
if len(excludedResults) == 0 {
324+
return ""
325+
}
326+
327+
var result strings.Builder
328+
result.WriteString(fmt.Sprintf("状态码不自然的域名 (%d个):\n", len(excludedResults)))
329+
330+
// 统计各种状态码
331+
statusCodeCounts := make(map[int]int)
332+
for _, domainResult := range excludedResults {
333+
if domainResult.Network != nil {
334+
statusCodeCounts[domainResult.Network.StatusCode]++
335+
}
336+
}
337+
338+
// 按状态码排序显示
339+
var statusCodes []int
340+
for statusCode := range statusCodeCounts {
341+
statusCodes = append(statusCodes, statusCode)
342+
}
343+
sort.Ints(statusCodes)
344+
345+
for _, statusCode := range statusCodes {
346+
count := statusCodeCounts[statusCode]
347+
result.WriteString(fmt.Sprintf(" - %d个状态码 %d\n", count, statusCode))
348+
}
349+
298350
return result.String()
299351
}
300352

@@ -342,38 +394,38 @@ func (bm *Manager) sortByRecommendationStars(results []*types.DetectionResult) {
342394
// calculateStars 计算域名的推荐星级数量
343395
func (bm *Manager) calculateStars(result *types.DetectionResult) int {
344396
stars := 0
345-
397+
346398
// 1. TLS硬性条件检查 (TLS1.3 + X25519 + H2 + SNI匹配)
347-
if result.TLS != nil && result.TLS.SupportsTLS13 &&
348-
result.TLS.SupportsX25519 && result.TLS.SupportsHTTP2 &&
349-
result.SNI != nil && result.SNI.SNIMatch {
399+
if result.TLS != nil && result.TLS.SupportsTLS13 &&
400+
result.TLS.SupportsX25519 && result.TLS.SupportsHTTP2 &&
401+
result.SNI != nil && result.SNI.SNIMatch {
350402
stars++
351403
}
352-
404+
353405
// 2. 握手时间延迟小 (<= 200ms)
354406
if result.TLS != nil && result.TLS.HandshakeTime > 0 {
355407
handshakeMs := int(result.TLS.HandshakeTime.Milliseconds())
356408
if handshakeMs <= 200 {
357409
stars++
358410
}
359411
}
360-
412+
361413
// 3. 没有CDN (不使用CDN更安全)
362414
if result.CDN == nil || !result.CDN.IsCDN {
363415
stars++
364416
}
365-
417+
366418
// 4. 不是热门网站 (热门网站不推荐作为Reality目标)
367419
if result.CDN != nil && !result.CDN.IsHotWebsite {
368420
stars++
369421
}
370-
422+
371423
// 5. 证书时间长 (>= 60天)
372424
if result.Certificate != nil && result.Certificate.Valid {
373425
if result.Certificate.DaysUntilExpiry >= 60 {
374426
stars++
375427
}
376428
}
377-
429+
378430
return stars
379431
}

0 commit comments

Comments
 (0)