1 Star 1 Fork 0

Ostaer / go-workwx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tls_key_log_helper.go 813 Bytes
一键复制 编辑 原始数据 按行查看 历史
package commands
import (
"crypto/tls"
"io"
"net"
"net/http"
"time"
"golang.org/x/net/http2"
)
// newTransportWithKeyLog initializes a HTTP Transport with KeyLogWriter
func newTransportWithKeyLog(keyLog io.Writer) *http.Transport {
transport := &http.Transport{
TLSClientConfig: &tls.Config{KeyLogWriter: keyLog, InsecureSkipVerify: true},
// Copy of http.DefaultTransport
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
if err := http2.ConfigureTransport(transport); err != nil {
panic(err)
}
return transport
}
1
https://gitee.com/ostaer/go-workwx.git
git@gitee.com:ostaer/go-workwx.git
ostaer
go-workwx
go-workwx
b16c285aee72

搜索帮助