mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2024-11-29 08:46:10 +03:00
Fix: add http timeout & disable keep-alive
This commit is contained in:
parent
394e406a36
commit
8375fbd8b3
@ -25,13 +25,12 @@ type Status struct {
|
|||||||
|
|
||||||
var client = &http.Client{
|
var client = &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
// from http.DefaultTransport
|
DisableKeepAlives: true,
|
||||||
MaxIdleConns: 100,
|
|
||||||
IdleConnTimeout: 90 * time.Second,
|
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
ExpectContinueTimeout: 1 * time.Second,
|
ExpectContinueTimeout: 1 * time.Second,
|
||||||
DialContext: dialer.DefaultTunnelDialer,
|
DialContext: dialer.DefaultTunnelDialer,
|
||||||
},
|
},
|
||||||
|
Timeout: 60 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
func openUrl(url string) (io.ReadCloser, error) {
|
func openUrl(url string) (io.ReadCloser, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user