Archived
2
0

custom ipfetch .

This commit is contained in:
Miroslav Šedivý
2021-06-26 13:44:41 +02:00
parent 3a79615a2b
commit 7aa7e0eacb
2 changed files with 13 additions and 5 deletions
server/internal
types
config
utils

@ -10,7 +10,7 @@ import (
// dig @resolver1.opendns.com ANY myip.opendns.com +short -4
func GetIP() (string, error) {
func GetIP(serverUrl string) (string, error) {
tr := &http.Transport{
Proxy: nil, // ignore proxy
DialContext: (&net.Dialer{
@ -25,7 +25,7 @@ func GetIP() (string, error) {
}
client := &http.Client{Transport: tr}
rsp, err := client.Get("http://checkip.amazonaws.com")
rsp, err := client.Get(serverUrl)
if err != nil {
return "", err
}