Skip to content

Commit

Permalink
fix issue #211
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyYe committed Aug 29, 2023
1 parent c5c5a27 commit 6b7d887
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/utils/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"regexp"
"strings"
"time"

"github.com/TimothyYe/godns/internal/settings"
dnsResolver "github.com/TimothyYe/godns/pkg/resolver"
Expand Down Expand Up @@ -97,7 +98,9 @@ func GetCurrentIP(configuration *settings.Settings) (string, error) {

// GetIPOnline gets public IP from internet.
func GetIPOnline(configuration *settings.Settings) (string, error) {
client := &http.Client{}
client := &http.Client{
Timeout: time.Second * defaultTimeout,
}
var reqURLs []string
var onlineIP string

Expand Down

0 comments on commit 6b7d887

Please sign in to comment.