mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
19 lines
332 B
Go
19 lines
332 B
Go
package http_client
|
|
|
|
import (
|
|
"github.com/go-resty/resty/v2"
|
|
"time"
|
|
)
|
|
|
|
// GetHttpClient 获取请求客户端
|
|
func GetHttpClient(proxys ...string) *resty.Client {
|
|
client := resty.New()
|
|
// 如果有代理
|
|
if len(proxys) > 0 {
|
|
proxy := proxys[0]
|
|
client.SetProxy(proxy)
|
|
}
|
|
client.SetTimeout(time.Second * 5)
|
|
return client
|
|
}
|