Add shadowtls tls config

This commit is contained in:
世界 2023-02-18 14:35:41 +08:00
parent a620cbcf2c
commit c095026177
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 36 additions and 3 deletions

View File

@ -10,8 +10,9 @@ import (
)
type (
STDConfig = tls.Config
STDConn = tls.Conn
STDConfig = tls.Config
STDConn = tls.Conn
ConnectionState = tls.ConnectionState
)
type Config interface {
@ -33,7 +34,7 @@ type ServerConfig interface {
type Conn interface {
net.Conn
HandshakeContext(ctx context.Context) error
ConnectionState() tls.ConnectionState
ConnectionState() ConnectionState
}
func ParseTLSVersion(version string) (uint16, error) {

View File

@ -0,0 +1,16 @@
//go:build !go1.20
package shadowtls
import sTLS "github.com/sagernet/sing-box/transport/shadowtls/tls_go119"
type (
sTLSConfig = sTLS.Config
sTLSConnectionState = sTLS.ConnectionState
sTLSConn = sTLS.Conn
)
var (
sTLSCipherSuites = sTLS.CipherSuites
sTLSClient = sTLS.Client
)

View File

@ -0,0 +1,16 @@
//go:build go1.20
package shadowtls
import sTLS "github.com/sagernet/sing-box/transport/shadowtls/tls"
type (
sTLSConfig = sTLS.Config
sTLSConnectionState = sTLS.ConnectionState
sTLSConn = sTLS.Conn
)
var (
sTLSCipherSuites = sTLS.CipherSuites
sTLSClient = sTLS.Client
)