Browse Source

correctly use socks proxy

this shouldn't be hardcoded, i'll eventually put it in the config file
master
alyssa rose 1 year ago committed by alyssa
parent
commit
dd27b1e875
  1. 6
      main.go

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

Loading…
Cancel
Save