link parse fx5
This commit is contained in:
parent
5caf565edb
commit
88006a8ed0
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -83,12 +84,13 @@ func SendRequest(method string, endpoint string, values []byte, authKey string)
|
||||||
func NewHttpClient() (http.Client, context.Context) {
|
func NewHttpClient() (http.Client, context.Context) {
|
||||||
const ConnectMaxWaitTime = 80 * time.Second
|
const ConnectMaxWaitTime = 80 * time.Second
|
||||||
const RequestMaxWaitTime = 120 * time.Second
|
const RequestMaxWaitTime = 120 * time.Second
|
||||||
|
proxyUrl, _ := url.Parse("http://79.98.129.183:3128")
|
||||||
client := http.Client{
|
client := http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DialContext: (&net.Dialer{
|
DialContext: (&net.Dialer{
|
||||||
Timeout: ConnectMaxWaitTime,
|
Timeout: ConnectMaxWaitTime,
|
||||||
}).DialContext,
|
}).DialContext,
|
||||||
|
Proxy: http.ProxyURL(proxyUrl),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue