1 Star 0 Fork 2

安易科技(北京)有限公司/chameleon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
http.go 452 Bytes
一键复制 编辑 原始数据 按行查看 历史
Derek Ray 提交于 2025-01-06 18:42 +08:00 . feat(daemon): add daemon service framework codes
package utils
import (
"crypto/tls"
"net/http"
"sync"
)
var (
hc *http.Client
once sync.Once
)
// HC returns a singleton http client, initialize only once
func HC() *http.Client {
once.Do(func() {
hc = &http.Client{}
transport := http.DefaultTransport.(*http.Transport).Clone()
transport.TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}
transport.ForceAttemptHTTP2 = true
hc.Transport = transport
})
return hc
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/anesec/chameleon.git
git@gitee.com:anesec/chameleon.git
anesec
chameleon
chameleon
205da4a0ed50

搜索帮助