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"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -37,6 +38,11 @@ func setupHttp() {
|
||||||
KeepAlive: 3 * time.Minute,
|
KeepAlive: 3 * time.Minute,
|
||||||
DualStack: true,
|
DualStack: true,
|
||||||
}).DialContext
|
}).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 := http.DefaultClient
|
||||||
client.Transport = tr
|
client.Transport = tr
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue