mirror of
https://github.com/Snawoot/hola-proxy.git
synced 2026-04-05 22:08:12 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a9f547cfe | ||
|
|
1984bb06ee |
@@ -14,10 +14,10 @@ Application is capable to forward traffic via proxies in datacenters (flag `-pro
|
||||
|
||||
Pre-built binaries available on [releases](https://github.com/Snawoot/hola-proxy/releases/latest) page.
|
||||
|
||||
Alternatively, you may install hola-proxy from source:
|
||||
Alternatively, you may install hola-proxy from source. Run within source directory
|
||||
|
||||
```
|
||||
go get github.com/Snawoot/hola-proxy
|
||||
go install
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -111,10 +111,13 @@ Usage of /home/user/go/bin/hola-proxy:
|
||||
output proxy list and exit
|
||||
-proxy-type string
|
||||
proxy type: direct or peer (default "direct")
|
||||
-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 10s)
|
||||
-verbosity int
|
||||
logging verbosity (10 - debug, 20 - info, 30 - warning, 40 - error, 50 - critical) (default 20)
|
||||
|
||||
```
|
||||
|
||||
@@ -154,7 +154,7 @@ func (s *ProxyHandler) ServeHTTP(wr http.ResponseWriter, req *http.Request) {
|
||||
proxyReq, err := makeConnReq(orig_req.RequestURI, s.resolver)
|
||||
if err != nil {
|
||||
s.logger.Error("Can't rewrite request: %v", err)
|
||||
http.Error(wr, "Can't rewrite request", http.StatusInternalServerError)
|
||||
http.Error(wr, "Can't rewrite request", http.StatusBadGateway)
|
||||
return
|
||||
}
|
||||
proxyReq.Header.Set("Proxy-Authorization", s.auth())
|
||||
|
||||
@@ -74,8 +74,9 @@ func (r *Resolver) ResolveAAAA(domain string) []string {
|
||||
}
|
||||
|
||||
func (r *Resolver) Resolve(domain string) []string {
|
||||
res := make([]string, 0)
|
||||
res = append(res, r.ResolveA(domain)...)
|
||||
res = append(res, r.ResolveAAAA(domain)...)
|
||||
res := r.ResolveA(domain)
|
||||
if len(res) == 0 {
|
||||
res = r.ResolveAAAA(domain)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user