Compare commits

...

2 Commits

Author SHA1 Message Date
Vladislav Yarmak
1a9f547cfe minor improvements 2020-04-14 11:45:03 +03:00
Vladislav Yarmak
1984bb06ee update docs 2020-04-14 00:11:04 +03:00
3 changed files with 10 additions and 6 deletions

View File

@@ -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)
```

View File

@@ -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())

View File

@@ -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
}