From 73eafb025151f7edc3fa4c77721481f92141ffe9 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Fri, 22 Jan 2021 12:20:27 +0300 Subject: [PATCH] Remove --tor option --- README.md | 12 +++++++++++- main.go | 6 ------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8b448bc..018d16a 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,20 @@ Other settings (available via `./gtranslate --help`: --proxy string Proxy URL, with no scheme http is assumed --static-dir string Static files directory (default "./static") --template-dir string Templates directory (default "./templates") - -T, --tor Use Tor Browser's User-Agent string --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 - Proper language selector - Dark theme diff --git a/main.go b/main.go index 58587a5..60ed973 100644 --- a/main.go +++ b/main.go @@ -39,14 +39,8 @@ func main() { staticDir := pflag.String("static-dir", "./static", "Static files directory") proxy := pflag.String("proxy", "", "Proxy URL, with no scheme http is assumed") 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() - 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 if *proxy != "" { u, err := url.Parse(*proxy)