mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
cast badtls
This commit is contained in:
parent
f91a90cad8
commit
254b60778c
@ -11,3 +11,7 @@ import (
|
|||||||
func NewReadWaitConn(conn tls.Conn) (tls.Conn, error) {
|
func NewReadWaitConn(conn tls.Conn) (tls.Conn, error) {
|
||||||
return nil, os.ErrInvalid
|
return nil, os.ErrInvalid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ReadWaitConn struct {
|
||||||
|
tls.Conn
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/sagernet/sing-box/common/badtls"
|
||||||
C "github.com/sagernet/sing-box/constant"
|
C "github.com/sagernet/sing-box/constant"
|
||||||
"github.com/sagernet/sing/common"
|
"github.com/sagernet/sing/common"
|
||||||
"github.com/sagernet/sing/common/buf"
|
"github.com/sagernet/sing/common/buf"
|
||||||
@ -68,6 +69,9 @@ func NewVisionConn(conn net.Conn, tlsConn net.Conn, userUUID [16]byte, logger lo
|
|||||||
reflectPointer uintptr
|
reflectPointer uintptr
|
||||||
netConn net.Conn
|
netConn net.Conn
|
||||||
)
|
)
|
||||||
|
if badtlsConn, ok := common.Cast[*badtls.ReadWaitConn](tlsConn); ok {
|
||||||
|
tlsConn = badtlsConn.Conn
|
||||||
|
}
|
||||||
for _, tlsCreator := range tlsRegistry {
|
for _, tlsCreator := range tlsRegistry {
|
||||||
loaded, netConn, reflectType, reflectPointer = tlsCreator(tlsConn)
|
loaded, netConn, reflectType, reflectPointer = tlsCreator(tlsConn)
|
||||||
if loaded {
|
if loaded {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user