mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-23 03:29:33 +02:00
custom ipfetch #63.
This commit is contained in:
parent
3a79615a2b
commit
7aa7e0eacb
2 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue