move dial functions into golib (#2767)

This commit is contained in:
fatedier
2022-01-20 20:03:07 +08:00
committed by GitHub
parent 293003fcdb
commit 70f4caac23
9 changed files with 114 additions and 195 deletions

View File

@@ -27,14 +27,6 @@ var (
FRPTLSHeadByte = 0x17
)
func WrapTLSClientConn(c net.Conn, tlsConfig *tls.Config, disableCustomTLSHeadByte bool) (out net.Conn) {
if !disableCustomTLSHeadByte {
c.Write([]byte{byte(FRPTLSHeadByte)})
}
out = tls.Client(c, tlsConfig)
return
}
func CheckAndEnableTLSServerConnWithTimeout(
c net.Conn, tlsConfig *tls.Config, tlsOnly bool, timeout time.Duration,
) (out net.Conn, isTLS bool, custom bool, err error) {