682aa3907a
- refine config loading with --config and current-directory .env - improve sqlite busy handling and runtime DB tuning - restore telegram payment notification and wallet input flow - add behavior-based config and callback recovery tests
20 lines
334 B
Go
20 lines
334 B
Go
package http_client
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/go-resty/resty/v2"
|
|
)
|
|
|
|
// GetHttpClient 获取请求客户端
|
|
func GetHttpClient(proxys ...string) *resty.Client {
|
|
client := resty.New()
|
|
// 如果有代理
|
|
if len(proxys) > 0 {
|
|
proxy := proxys[0]
|
|
client.SetProxy(proxy)
|
|
}
|
|
client.SetTimeout(time.Second * 10)
|
|
return client
|
|
}
|