1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-05 00:50:24 +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"
"time"
"github.com/fumiama/terasu"
"github.com/pkg/errors"
"github.com/rs/zerolog"
@@ -161,7 +162,7 @@ func lookupSRVWithDOT(srvService string, srvProto string, srvName string) (cname
return nil, err
}
tlsConfig := &tls.Config{ServerName: dotServerName}
return tls.Client(conn, tlsConfig), nil
return tls.Client(terasu.NewConn(conn), tlsConfig), nil
},
}
ctx, cancel := context.WithTimeout(context.Background(), dotTimeout)

View File

@@ -6,6 +6,7 @@ import (
"net"
"time"
"github.com/fumiama/terasu"
"github.com/pkg/errors"
)
@@ -30,7 +31,7 @@ func DialEdge(
return nil, newDialError(err, "DialContext error")
}
tlsEdgeConn := tls.Client(edgeConn, tlsConfig)
tlsEdgeConn := tls.Client(terasu.NewConn(edgeConn), tlsConfig)
tlsEdgeConn.SetDeadline(time.Now().Add(timeout))
if err = tlsEdgeConn.Handshake(); err != nil {