tls

package
v1.18.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const RealityMaxShortIDLen = 8

Variables

View Source
var Fingerprints = map[string]UClientHelloID{
	"chrome":                     {&utls.HelloChrome_Auto},
	"chrome_psk":                 {&utls.HelloChrome_100_PSK},
	"chrome_psk_shuffle":         {&utls.HelloChrome_106_Shuffle},
	"chrome_padding_psk_shuffle": {&utls.HelloChrome_114_Padding_PSK_Shuf},
	"chrome_pq":                  {&utls.HelloChrome_115_PQ},
	"chrome_pq_psk":              {&utls.HelloChrome_115_PQ_PSK},
	"firefox":                    {&utls.HelloFirefox_Auto},
	"safari":                     {&utls.HelloSafari_Auto},
	"ios":                        {&utls.HelloIOS_Auto},
	"android":                    {&utls.HelloAndroid_11_OkHttp},
	"edge":                       {&utls.HelloEdge_Auto},
	"360":                        {&utls.Hello360_Auto},
	"qq":                         {&utls.HelloQQ_Auto},
	"random":                     {nil},
	"randomized":                 {nil},
}

Functions

func GetGlobalFingerprint

func GetGlobalFingerprint() string

func GetRealityConn

func GetRealityConn(ctx context.Context, conn net.Conn, ClientFingerprint string, tlsConfig *tls.Config, realityConfig *RealityConfig) (net.Conn, error)

func HaveGlobalFingerprint

func HaveGlobalFingerprint() bool

func SetGlobalUtlsClient

func SetGlobalUtlsClient(Client string)

Types

type RealityConfig

type RealityConfig struct {
	PublicKey *ecdh.PublicKey
	ShortID   [RealityMaxShortIDLen]byte
}

type UClientHelloID

type UClientHelloID struct {
	*utls.ClientHelloID
}

func GetFingerprint

func GetFingerprint(ClientFingerprint string) (UClientHelloID, bool)

func RollFingerprint

func RollFingerprint() (UClientHelloID, bool)

type UConn

type UConn struct {
	*utls.UConn
}

func UClient

func UClient(c net.Conn, config *tls.Config, fingerprint UClientHelloID) *UConn

func (*UConn) BuildWebsocketHandshakeState

func (c *UConn) BuildWebsocketHandshakeState() error

BuildWebsocketHandshakeState it will only send http/1.1 in its ALPN. Copy from https://github.com/XTLS/Xray-core/blob/main/transport/internet/tls/tls.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL