Skip to content

Commit

Permalink
psiphon: more code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Pashmfouroush <mark@markpash.me>
  • Loading branch information
markpash committed Jul 27, 2024
1 parent fc5c070 commit 53062e2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 38 deletions.
40 changes: 2 additions & 38 deletions cmd/warp-plus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

"github.com/adrg/xdg"
"github.com/bepass-org/warp-plus/app"
p "github.com/bepass-org/warp-plus/psiphon"
"github.com/bepass-org/warp-plus/warp"
"github.com/bepass-org/warp-plus/wiresocks"

Expand All @@ -25,43 +26,6 @@ import (

const appName = "warp-plus"

var psiphonCountries = []string{
"AT",
"AU",
"BE",
"BG",
"BR",
"CA",
"CH",
"CZ",
"DE",
"DK",
"EE",
"ES",
"FI",
"FR",
"GB",
"HR",
"HU",
"ID",
"IE",
"IN",
"IT",
"JP",
"LV",
"NL",
"NO",
"PL",
"PT",
"RO",
"RS",
"SE",
"SG",
"SK",
"UA",
"US",
}

var version string = ""

func main() {
Expand All @@ -76,7 +40,7 @@ func main() {
dns = fs.StringLong("dns", "1.1.1.1", "DNS address")
gool = fs.BoolLong("gool", "enable gool mode (warp in warp)")
psiphon = fs.BoolLong("cfon", "enable psiphon mode (must provide country as well)")
country = fs.StringEnumLong("country", fmt.Sprintf("psiphon country code (valid values: %s)", psiphonCountries), psiphonCountries...)
country = fs.StringEnumLong("country", fmt.Sprintf("psiphon country code (valid values: %s)", p.Countries), p.Countries...)
scan = fs.BoolLong("scan", "enable warp scanning")
rtt = fs.DurationLong("rtt", 1000*time.Millisecond, "scanner rtt limit")
cacheDir = fs.StringLong("cache-dir", "", "directory to store generated profiles")
Expand Down
37 changes: 37 additions & 0 deletions psiphon/p.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@ import (
"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon"
)

var Countries = []string{
"AT",
"AU",
"BE",
"BG",
"BR",
"CA",
"CH",
"CZ",
"DE",
"DK",
"EE",
"ES",
"FI",
"FR",
"GB",
"HR",
"HU",
"ID",
"IE",
"IN",
"IT",
"JP",
"LV",
"NL",
"NO",
"PL",
"PT",
"RO",
"RS",
"SE",
"SG",
"SK",
"UA",
"US",
}

// NoticeEvent represents the notices emitted by tunnel core. It will be passed to
// noticeReceiver, if supplied.
// NOTE: Ordinary users of this library should never need this.
Expand Down

0 comments on commit 53062e2

Please sign in to comment.