Skip to content

Commit

Permalink
Removed start process timeout arg
Browse files Browse the repository at this point in the history
updated README.md
  • Loading branch information
SonyaCore committed Apr 13, 2023
1 parent d2ebb90 commit 88ed541
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions golang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions golang/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]")

}
2 changes: 0 additions & 2 deletions golang/configuration/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions golang/configuration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions golang/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion golang/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 1 addition & 3 deletions golang/vpn/xray.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 88ed541

Please sign in to comment.