mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user