diff --git a/golang/README.md b/golang/README.md index e733d2ea..5e201373 100644 --- a/golang/README.md +++ b/golang/README.md @@ -75,7 +75,7 @@ CFScanner takes several arguments: | --threads -t | Number of threads to use for parallel scanning. Default is 1. | | --config -c | The path to the config file. (Required) | | --vpn | If passed, test with creating xray-core connections. | -| -l --loglevel | The log level for xray-core (default "none") | +| --loglevel -l | The log level for xray-core (default "none") | | --subnets -s | The file or subnet. Each line should be in the form of ip.ip.ip.ip/subnet_mask or ip.ip.ip.ip. | | --shuffle | Shuffling given subnet file or input | | --upload | If passed, upload test will be conducted. | @@ -88,7 +88,6 @@ CFScanner takes several arguments: | --fronting-timeout | Maximum time to wait for fronting response. Default is 1.0. | | --download-latency | Maximum allowed latency for download. Default is 2.0. | | --upload-latency | Maximum allowed latency for upload. Default is 2.0. | -| --startprocess-timeout | Process timeout for v2ray. Default is 12. | | --writer | Custom output writer for writing interim results. available writers : `csv`/`json` | # Features diff --git a/golang/cmd.go b/golang/cmd.go index 72864f9b..7901988b 100644 --- a/golang/cmd.go +++ b/golang/cmd.go @@ -19,7 +19,6 @@ var minULSpeed float64 var maxDLTime float64 var maxULTime float64 -var startProcessTimeout float64 var frontingTimeout float64 var maxDLLatency float64 var maxULLatency float64 @@ -45,7 +44,6 @@ func RegisterCommands(rootCmd *cobra.Command) { rootCmd.PersistentFlags().Float64Var(&frontingTimeout, "fronting-timeout", 1.0, "Maximum time to wait for fronting response") rootCmd.PersistentFlags().Float64Var(&maxDLLatency, "download-latency", 3.0, "Maximum allowed latency for download") rootCmd.PersistentFlags().Float64Var(&maxULLatency, "upload-latency", 3.0, "Maximum allowed latency for upload") - rootCmd.PersistentFlags().Float64Var(&startProcessTimeout, "startprocess-timeout", 12, "Process timeout for v2ray") rootCmd.PersistentFlags().StringVar(&writerType, "writer", "csv", "Custom output writer for writing interim results. [csv/json]") } diff --git a/golang/configuration/config.go b/golang/configuration/config.go index 45946379..ce6ec80e 100644 --- a/golang/configuration/config.go +++ b/golang/configuration/config.go @@ -30,7 +30,6 @@ WS Header Host: %v%v%v WS Header Path : %v%v%v Address Port : %v%v%v SNI : %v%v%v -Start Proccess Timeout : %v%v%v Upload Test : %v%v%v Fronting Request Test : %v%v%v Minimum Download Speed : %v%v%v @@ -53,7 +52,6 @@ Total Threads : %v%v%v utils.Colors.OKBLUE, C.Config.WsHeaderPath, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.AddressPort, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.Sni, utils.Colors.ENDC, - utils.Colors.OKBLUE, C.Worker.StartProcessTimeout, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.DoUploadTest, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Config.DoFrontingTest, utils.Colors.ENDC, utils.Colors.OKBLUE, C.Worker.Download.MinDlSpeed, utils.Colors.ENDC, diff --git a/golang/configuration/types.go b/golang/configuration/types.go index 13938bc0..86873420 100644 --- a/golang/configuration/types.go +++ b/golang/configuration/types.go @@ -8,11 +8,10 @@ type Configuration struct { } type Worker struct { - Download Download - Upload Upload - StartProcessTimeout float64 // seconds - Threads int - Vpn bool + Download Download + Upload Upload + Threads int + Vpn bool } type ConfigStruct struct { diff --git a/golang/run.go b/golang/run.go index 5c16a360..d26c84db 100644 --- a/golang/run.go +++ b/golang/run.go @@ -78,9 +78,8 @@ func run() *cobra.Command { }, Worker: configuration.Worker{ - Threads: threads, - Vpn: Vpn, - StartProcessTimeout: startProcessTimeout, + Threads: threads, + Vpn: Vpn, Download: struct { MinDlSpeed float64 MaxDlTime float64 diff --git a/golang/scanner/scanner.go b/golang/scanner/scanner.go index fa792bc3..343cf6db 100644 --- a/golang/scanner/scanner.go +++ b/golang/scanner/scanner.go @@ -73,7 +73,7 @@ func scanner(ip string, C config.Configuration, Worker config.Worker) *Result { } var err error - process = vpn.XRayInstance(xrayConfigPath, time.Duration(Worker.StartProcessTimeout)) + process = vpn.XRayInstance(xrayConfigPath) if err != nil { log.Printf("%vERROR - %vCould not start vpn service%v\n", diff --git a/golang/vpn/xray.go b/golang/vpn/xray.go index 37af2ab1..0167f319 100644 --- a/golang/vpn/xray.go +++ b/golang/vpn/xray.go @@ -6,8 +6,6 @@ import ( "log" "os" "os/signal" - "time" - // The following are necessary as they register handlers in their init functions. _ "github.com/xtls/xray-core/app/dispatcher" @@ -94,7 +92,7 @@ import ( //_ "github.com/xtls/xray-core/main/commands/all" ) -func XRayInstance(configPath string, timeout time.Duration) ScanWorker { +func XRayInstance(configPath string) ScanWorker { config, err := LoadConfig(configPath) if err != nil { log.Fatal(err)