From df549ddc33653ddf8d9f9499eb6cbadef59cbd27 Mon Sep 17 00:00:00 2001 From: Jemy Zhang Date: Sat, 21 Mar 2020 18:14:37 +0800 Subject: [PATCH] remove proxy while getting the public ip remove proxy while getting the public ip, otherwise ip of socks server would be returned --- utils.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/utils.go b/utils.go index 1b26805..cec9ec3 100644 --- a/utils.go +++ b/utils.go @@ -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