From 9f3f2fbb4a4b5e6b26566f89993ca8434a0c1359 Mon Sep 17 00:00:00 2001 From: Alexey Yerin Date: Mon, 18 Jan 2021 23:30:26 +0300 Subject: [PATCH] Add -T option to mimic Tor Browser's User-Agent --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 60ed973..58587a5 100644 --- a/main.go +++ b/main.go @@ -39,8 +39,14 @@ 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)