1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-21 11:20:26 +08:00

feat: embed terasu inside

This commit is contained in:
源文雨
2025-12-21 16:51:38 +08:00
parent 0d2a7a0385
commit f99b9330df
23 changed files with 1195 additions and 18 deletions

View File

@@ -7,6 +7,7 @@ import (
"net"
"net/http"
"github.com/fumiama/terasu"
"github.com/rs/zerolog"
)
@@ -64,6 +65,9 @@ func (o *httpService) SetOriginServerName(req *http.Request) {
if err != nil {
return nil, err
}
if tc, ok := conn.(*net.TCPConn); ok {
conn = terasu.NewConn(tc)
}
return tls.Client(conn, &tls.Config{
RootCAs: o.transport.TLSClientConfig.RootCAs,
InsecureSkipVerify: o.transport.TLSClientConfig.InsecureSkipVerify, // nolint: gosec