Skip to content

Commit 603b7f5

Browse files
committed
feat(preconfig_tester): exit immediatly if blocks not found for all domains
1 parent 0289ad3 commit 603b7f5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cmd/preconfig_tester/preconfig_tester.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,9 @@ func runBypassCheck(config Config) error {
331331
fmt.Printf("\nStarting testing domains: %s\n", config.targetDomain)
332332
fmt.Println("------------------------------------------------")
333333

334+
needBypass := false
334335
// Check DPI for each domain
335336
for _, domain := range domains {
336-
// Remove port before DPI check but keep it for display
337337
domainForCheck := strings.Split(domain, ":")[0]
338338
fmt.Printf("\nChecking DPI blocks for %s...\n", domainForCheck)
339339
result, err := checkDPIFingerprint(domainForCheck)
@@ -352,6 +352,13 @@ func runBypassCheck(config Config) error {
352352
fmt.Printf("Check internet connection and if domain %s is correct.\n", domainForCheck)
353353
continue
354354
}
355+
356+
needBypass = true
357+
}
358+
359+
if !needBypass {
360+
fmt.Println("\nNo DPI blocks detected for any domain. No need to test pre-configs.")
361+
return nil
355362
}
356363

357364
fmt.Println("------------------------------------------------")

0 commit comments

Comments
 (0)