Compare commits

...

6 Commits

Author SHA1 Message Date
Vladislav Yarmak
332db446b4 bump snap version 2024-11-25 19:07:19 +02:00
Vladislav Yarmak
8020fba8f3 use timeout defaults as specified in doc 2024-11-25 19:07:03 +02:00
Snawoot
f659f26bad Merge pull request #130 from Snawoot/bump_timeout
Bump timeout
2024-11-25 19:05:42 +02:00
Vladislav Yarmak
ce356ce015 bump timeout 2024-11-25 19:05:05 +02:00
Snawoot
e8cd8ba0a8 Merge pull request #129 from Snawoot/improve_fbc
Add more fallback config endpoints
2024-11-25 19:03:44 +02:00
Vladislav Yarmak
191b1e7f51 Add more fallback config endpoints 2024-11-25 18:48:18 +02:00
3 changed files with 9 additions and 4 deletions

View File

@@ -32,9 +32,13 @@ const CCGI_URL = "https://client.hola.org/client_cgi/"
const VPN_COUNTRIES_URL = CCGI_URL + "vpn_countries.json"
const BG_INIT_URL = CCGI_URL + "background_init"
const ZGETTUNNELS_URL = CCGI_URL + "zgettunnels"
const FALLBACK_CONF_URL = "https://www.dropbox.com/s/jemizcvpmf2qb9v/cloud_failover.conf?dl=1"
const AGENT_SUFFIX = ".hola.org"
var FALLBACK_CONF_URLS = []string{
"https://www.dropbox.com/s/jemizcvpmf2qb9v/cloud_failover.conf?dl=1",
"https://vdkd6nz8qr.s3.amazonaws.com/cloud_failover.conf",
}
var LOGIN_TEMPLATE = template.Must(template.New("LOGIN_TEMPLATE").Parse("user-uuid-{{.uuid}}-is_prem-{{.prem}}"))
var TemporaryBanError = errors.New("temporary ban detected")
var PermanentBanError = errors.New("permanent ban detected")
@@ -274,7 +278,8 @@ func zgettunnels(ctx context.Context,
func fetchFallbackConfig(ctx context.Context) (*FallbackConfig, error) {
client := httpClientWithProxy(nil)
confRaw, err := do_req(ctx, client, "", FALLBACK_CONF_URL, nil, nil)
fallbackConfURL := FALLBACK_CONF_URLS[rand.New(RandomSource).Intn(len(FALLBACK_CONF_URLS))]
confRaw, err := do_req(ctx, client, "", fallbackConfURL, nil, nil)
if err != nil {
return nil, err
}

View File

@@ -82,7 +82,7 @@ func parse_args() CLIArgs {
flag.StringVar(&args.bind_address, "bind-address", "127.0.0.1:8080", "HTTP proxy listen address")
flag.IntVar(&args.verbosity, "verbosity", 20, "logging verbosity "+
"(10 - debug, 20 - info, 30 - warning, 40 - error, 50 - critical)")
flag.DurationVar(&args.timeout, "timeout", 10*time.Second, "timeout for network operations")
flag.DurationVar(&args.timeout, "timeout", 35*time.Second, "timeout for network operations")
flag.DurationVar(&args.rotate, "rotate", 1*time.Hour, "rotate user ID once per given period")
flag.DurationVar(&args.backoffInitial, "backoff-initial", 3*time.Second, "initial average backoff delay for zgettunnels (randomized by +/-50%)")
flag.DurationVar(&args.backoffDeadline, "backoff-deadline", 5*time.Minute, "total duration of zgettunnels method attempts")

View File

@@ -1,5 +1,5 @@
name: hola-proxy
version: '1.14.0'
version: '1.15.0'
summary: Standalone Hola proxy client.
description: |
Standalone Hola proxy client. Just run it and it'll start plain HTTP proxy server forwarding traffic via Hola proxies of your choice.