Compare commits

..

8 Commits

Author SHA1 Message Date
Vladislav Yarmak
838463b771 bump snap version 2023-12-01 14:40:30 +02:00
Snawoot
2ff8391919 Merge pull request #110 from Snawoot/cust_user_agent
Customizable User-Agent
2023-12-01 14:39:40 +02:00
Vladislav Yarmak
54fa9a4831 upd doc 2023-12-01 14:39:14 +02:00
Vladislav Yarmak
679ac56806 customizable User-Agent 2023-12-01 14:36:30 +02:00
Vladislav Yarmak
47721e844a fix go version for compat build 2023-11-12 15:17:46 +02:00
Snawoot
fa8ea7356f Merge pull request #108 from Snawoot/windows_compat
ci: compat with old windows
2023-11-12 15:06:11 +02:00
Vladislav Yarmak
c54c588b17 ci: compat with old windows 2023-11-12 15:02:06 +02:00
Vladislav Yarmak
ad9ecc60ff bump snap version 2023-11-12 02:45:24 +02:00
5 changed files with 41 additions and 8 deletions

View File

@@ -17,22 +17,41 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Read tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
-
name: Read tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
-
name: Build
run: >-
make -j $(nproc) allplus
make -j $(nproc)
bin-linux-amd64 bin-linux-386 bin-linux-arm bin-linux-arm64
bin-linux-mips bin-linux-mipsle bin-linux-mips64 bin-linux-mips64le
bin-freebsd-amd64 bin-freebsd-386 bin-freebsd-arm
bin-netbsd-amd64 bin-netbsd-386
bin-openbsd-amd64 bin-openbsd-386
bin-darwin-amd64 bin-darwin-arm64
bin-android-arm bin-android-arm64
NDK_CC_ARM64="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
NDK_CC_ARM="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang"
VERSION=${{steps.tag.outputs.tag}}
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '~1.20'
-
name: Build
run: >-
make -j $(nproc)
bin-windows-amd64 bin-windows-386 bin-windows-arm
VERSION=${{steps.tag.outputs.tag}}
GO120=go
-
name: Release
uses: softprops/action-gh-release@v1

View File

@@ -173,6 +173,7 @@ zagent248.hola.org,165.22.65.3,22222,22223,22224,22225,22226,digitalocean
| resolver | String | DNS/DoH/DoT resolver to workaround Hola blocked hosts. See https://github.com/ameshkov/dnslookup/ for upstream DNS URL format. (default "https://cloudflare-dns.com/dns-query") |
| rotate | Duration | rotate user ID once per given period (default 1h0m0s) |
| timeout | Duration | timeout for network operations (default 35s) |
| user-agent | String | value of User-Agent header in requests (default "Mozilla/5.0 (X11; Linux x86\_64; rv:109.0) Gecko/20100101 Firefox/118.0") |
| verbosity | Number | logging verbosity (10 - debug, 20 - info, 30 - warning, 40 - error, 50 - critical) (default 20) |
## See also

View File

@@ -26,7 +26,6 @@ import (
"github.com/google/uuid"
)
const USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
const EXT_BROWSER = "chrome"
const PRODUCT = "cws"
const CCGI_URL = "https://client.hola.org/client_cgi/"
@@ -41,6 +40,16 @@ var TemporaryBanError = errors.New("temporary ban detected")
var PermanentBanError = errors.New("permanent ban detected")
var EmptyResponseError = errors.New("empty response")
var userAgent = "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0"
func SetUserAgent(ua string) {
userAgent = ua
}
func GetUserAgent() string {
return userAgent
}
type CountryList []string
type BgInitResponse struct {
@@ -158,7 +167,7 @@ func do_req(ctx context.Context, client *http.Client, method, url string, query,
if query != nil {
req.URL.RawQuery = query.Encode()
}
req.Header.Set("User-Agent", USER_AGENT)
req.Header.Set("User-Agent", userAgent)
resp, err := client.Do(req)
if err != nil {
return nil, err

View File

@@ -65,6 +65,7 @@ type CLIArgs struct {
backoffInitial time.Duration
backoffDeadline time.Duration
hideSNI bool
userAgent string
}
func parse_args() CLIArgs {
@@ -94,6 +95,7 @@ func parse_args() CLIArgs {
"Format: <http|https|socks5|socks5h>://[login:password@]host[:port] "+
"Examples: http://user:password@192.168.1.1:3128, socks5://10.0.0.1:1080")
flag.StringVar(&args.caFile, "cafile", "", "use custom CA certificate bundle file")
flag.StringVar(&args.userAgent, "user-agent", GetUserAgent(), "value of User-Agent header in requests")
flag.BoolVar(&args.hideSNI, "hide-SNI", true, "hide SNI in TLS sessions with proxy server")
flag.Parse()
if args.country == "" {
@@ -176,6 +178,8 @@ func run() int {
UpdateHolaDialer(dialer)
}
SetUserAgent(args.userAgent)
if args.list_countries {
return print_countries(args.timeout)
}

View File

@@ -1,5 +1,5 @@
name: hola-proxy
version: '1.11.0'
version: '1.12.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.