mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
485059f60e
- Updated script and module preload links in index.html for optimized loading. - Modified service worker (sw.js) to reflect new asset revisions and improve caching strategy. - Updated configuration documentation in BT_RUN.md, docker-RUN.md, and manual_RUN.md to clarify currency rate settings.
23 lines
438 B
Go
23 lines
438 B
Go
package http_client
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-resty/resty/v2"
|
|
)
|
|
|
|
// ClientFactory is overridden in tests to stub outbound HTTP calls.
|
|
var ClientFactory = resty.New
|
|
|
|
// GetHttpClient 获取请求客户端
|
|
func GetHttpClient(proxys ...string) *resty.Client {
|
|
client := ClientFactory()
|
|
// 如果有代理
|
|
if len(proxys) > 0 {
|
|
proxy := proxys[0]
|
|
client.SetProxy(proxy)
|
|
}
|
|
client.SetTimeout(time.Second * 10)
|
|
return client
|
|
}
|