1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

Merge pull request #57 from jemyzhang/master

proxy should not be used while getting public ip
This commit is contained in:
Timothy 2020-03-21 23:09:08 +08:00 committed by GitHub
commit 4ca167ac43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,19 +159,6 @@ func GetCurrentIP(configuration *Settings) (string, error) {
func GetIPOnline(configuration *Settings) (string, error) {
client := &http.Client{}
if configuration.Socks5Proxy != "" {
log.Println("use socks5 proxy:" + configuration.Socks5Proxy)
dialer, err := proxy.SOCKS5("tcp", configuration.Socks5Proxy, nil, proxy.Direct)
if err != nil {
log.Println("can't connect to the proxy:", err)
return "", err
}
httpTransport := &http.Transport{}
client.Transport = httpTransport
httpTransport.Dial = dialer.Dial
}
var response *http.Response
var err error