Add VLESS server, vision flow and reality TLS
This commit is contained in:
23
transport/vless/vision_reality.go
Normal file
23
transport/vless/vision_reality.go
Normal file
@@ -0,0 +1,23 @@
|
||||
//go:build with_reality_server
|
||||
|
||||
package vless
|
||||
|
||||
import (
|
||||
"net"
|
||||
"reflect"
|
||||
"unsafe"
|
||||
|
||||
"github.com/sagernet/sing/common"
|
||||
|
||||
"github.com/nekohasekai/reality"
|
||||
)
|
||||
|
||||
func init() {
|
||||
tlsRegistry = append(tlsRegistry, func(conn net.Conn) (loaded bool, netConn net.Conn, reflectType reflect.Type, reflectPointer uintptr) {
|
||||
tlsConn, loaded := common.Cast[*reality.Conn](conn)
|
||||
if !loaded {
|
||||
return
|
||||
}
|
||||
return true, tlsConn.NetConn(), reflect.TypeOf(tlsConn).Elem(), uintptr(unsafe.Pointer(tlsConn))
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user