fix:调整超时时间
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
.idea/
|
||||
Mmx
|
||||
Mmx*
|
||||
Config.json
|
||||
/GoBuilder.bat
|
||||
|
||||
@@ -26,7 +26,7 @@ func Get(Url string, Query map[string]string) (string, error) {
|
||||
resp, err := (&http.Client{
|
||||
Transport: &http.Transport{
|
||||
DialContext: (&net.Dialer{
|
||||
Timeout: 30 * time.Second,
|
||||
Timeout: 10 * time.Second,
|
||||
Resolver: &net.Resolver{
|
||||
PreferGo: true,
|
||||
Dial: Util.NetDailEr(),
|
||||
|
||||
@@ -64,7 +64,7 @@ func ErrHandler(err error) {
|
||||
func NetDailEr() func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
return func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
d := net.Dialer{
|
||||
Timeout: 20 * time.Second,
|
||||
Timeout: 5 * time.Second,
|
||||
}
|
||||
return d.DialContext(ctx, "udp", Global.Config.Settings.Dns+":53")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user