Skip to content

Commit

Permalink
feat(preconfig_tester): exit immediatly if blocks not found for all d…
Browse files Browse the repository at this point in the history
…omains
  • Loading branch information
ankddev committed Dec 13, 2024
1 parent 0289ad3 commit 603b7f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/preconfig_tester/preconfig_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ func runBypassCheck(config Config) error {
fmt.Printf("\nStarting testing domains: %s\n", config.targetDomain)
fmt.Println("------------------------------------------------")

needBypass := false
// Check DPI for each domain
for _, domain := range domains {
// Remove port before DPI check but keep it for display
domainForCheck := strings.Split(domain, ":")[0]
fmt.Printf("\nChecking DPI blocks for %s...\n", domainForCheck)
result, err := checkDPIFingerprint(domainForCheck)
Expand All @@ -352,6 +352,13 @@ func runBypassCheck(config Config) error {
fmt.Printf("Check internet connection and if domain %s is correct.\n", domainForCheck)
continue
}

needBypass = true
}

if !needBypass {
fmt.Println("\nNo DPI blocks detected for any domain. No need to test pre-configs.")
return nil
}

fmt.Println("------------------------------------------------")
Expand Down

0 comments on commit 603b7f5

Please sign in to comment.