@@ -35,8 +35,12 @@ func main() {
35
35
flag .Usage = usage
36
36
flag .Parse ()
37
37
38
+ RunWarp (* psiphonEnabled , * gool , * scan , * verbose , * country , * bindAddress , * endpoint , * license )
39
+ }
40
+
41
+ func RunWarp (psiphonEnabled , gool , scan , verbose bool , country , bindAddress , endpoint , license string ) {
38
42
// check if user input is not correct
39
- if (* psiphonEnabled && * gool ) || (! * psiphonEnabled && * country != "" ) {
43
+ if (psiphonEnabled && gool ) || (! psiphonEnabled && country != "" ) {
40
44
log .Println ("Wrong command!" )
41
45
flag .Usage ()
42
46
return
@@ -46,26 +50,26 @@ func main() {
46
50
makeDirs ()
47
51
48
52
//create identities
49
- createPrimaryAndSecondaryIdentities (* license )
53
+ createPrimaryAndSecondaryIdentities (license )
50
54
51
55
//Decide Working Scenario
52
- endpoints := []string {* endpoint , * endpoint }
56
+ endpoints := []string {endpoint , endpoint }
53
57
54
- if * scan {
58
+ if scan {
55
59
endpoints = wiresocks .RunScan ()
56
60
log .Println ("Cooling down please wait 5 seconds..." )
57
61
time .Sleep (5 * time .Second )
58
62
}
59
63
60
- if ! * psiphonEnabled && ! * gool {
64
+ if ! psiphonEnabled && ! gool {
61
65
// just run primary warp on bindAddress
62
- runWarp (* bindAddress , endpoints , "./primary/wgcf-profile.ini" , * verbose , true , true )
63
- } else if * psiphonEnabled && ! * gool {
66
+ runWarp (bindAddress , endpoints , "./primary/wgcf-profile.ini" , verbose , true , true )
67
+ } else if psiphonEnabled && ! gool {
64
68
// run primary warp on a random tcp port and run psiphon on bind address
65
- runWarpWithPsiphon (* bindAddress , endpoints , * country , * verbose )
66
- } else if ! * psiphonEnabled && * gool {
69
+ runWarpWithPsiphon (bindAddress , endpoints , country , verbose )
70
+ } else if ! psiphonEnabled && gool {
67
71
// run warp in warp
68
- runWarpInWarp (* bindAddress , endpoints , * verbose )
72
+ runWarpInWarp (bindAddress , endpoints , verbose )
69
73
}
70
74
71
75
//End Decide Working Scenario
0 commit comments