correctly use socks proxy
this shouldn't be hardcoded, i'll eventually put it in the config file
This commit is contained in:
parent
f5437ff3ce
commit
dd27b1e875
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…
Reference in New Issue