tls

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 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},
	"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 [curve25519.ScalarSize]byte
	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