From dd27b1e87561b6b1433307ec121458cd771229bc Mon Sep 17 00:00:00 2001 From: alyssa Date: Tue, 9 Mar 2021 21:24:13 +0000 Subject: [PATCH] correctly use socks proxy this shouldn't be hardcoded, i'll eventually put it in the config file --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 636c59c..5c08440 100644 --- a/main.go +++ b/main.go @@ -6,6 +6,7 @@ import ( "log" "net" "net/http" + "net/url" "os" "path/filepath" "strings" @@ -37,6 +38,11 @@ func setupHttp() { KeepAlive: 3 * time.Minute, DualStack: true, }).DialContext + proxyUrl, err := url.Parse("socks5://127.0.0.1:8080") + if err != nil { + log.Fatalln(err) + } + tr.Proxy = http.ProxyURL(proxyUrl) client := http.DefaultClient client.Transport = tr }