Remove --tor option

This commit is contained in:
Alexey Yerin 2021-01-22 12:20:27 +03:00
parent cd948c5660
commit 73eafb0251
2 changed files with 11 additions and 7 deletions

View File

@ -38,10 +38,20 @@ Other settings (available via `./gtranslate --help`:
--proxy string Proxy URL, with no scheme http is assumed --proxy string Proxy URL, with no scheme http is assumed
--static-dir string Static files directory (default "./static") --static-dir string Static files directory (default "./static")
--template-dir string Templates directory (default "./templates") --template-dir string Templates directory (default "./templates")
-T, --tor Use Tor Browser's User-Agent string
--user-agent string User-Agent header to use --user-agent string User-Agent header to use
``` ```
If you want to proxy requests through Tor network, it's a good idea to
set User-Agent of Tor Browser so it will be harder to identify such
servers:
```
./gtranslate \
--user-agent "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0" \
...
```
[Source](https://tor.stackexchange.com/questions/4890/tor-browser-user-agent-strings/21524#21524)
# TODO # TODO
- Proper language selector - Proper language selector
- Dark theme - Dark theme

View File

@ -39,14 +39,8 @@ func main() {
staticDir := pflag.String("static-dir", "./static", "Static files directory") staticDir := pflag.String("static-dir", "./static", "Static files directory")
proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed") proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed")
userAgent := pflag.String("user-agent", "", "User-Agent header to use") userAgent := pflag.String("user-agent", "", "User-Agent header to use")
tor := pflag.BoolP("tor", "T", false, "Use Tor Browser's User-Agent string")
pflag.Parse() pflag.Parse()
if *tor {
// https://tor.stackexchange.com/questions/4890/tor-browser-user-agent-strings/4892#4892
*userAgent = "Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0"
}
var proxyUrl *url.URL var proxyUrl *url.URL
if *proxy != "" { if *proxy != "" {
u, err := url.Parse(*proxy) u, err := url.Parse(*proxy)