tls

package
v0.0.0-...-45a9176 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fingerprints = map[string]UClientHelloID{
	"chrome":     {&utls.HelloChrome_Auto},
	"firefox":    {&utls.HelloFirefox_Auto},
	"safari":     {&utls.HelloSafari_Auto},
	"ios":        {&utls.HelloIOS_Auto},
	"randomized": {&utls.HelloRandomized},
}

Functions

func AddCertificate

func AddCertificate(privateKey, certificate string) error

func GetCertificates

func GetCertificates() []tls.Certificate

func GetDefaultTLSConfig

func GetDefaultTLSConfig() *tls.Config

func GetGlobalFingerprint

func GetGlobalFingerprint() string

func GetGlobalTLSConfig

func GetGlobalTLSConfig(tlsConfig *tls.Config) *tls.Config

func GetGlobalXTLSConfig

func GetGlobalXTLSConfig(tlsConfig *xtls.Config) *xtls.Config

func GetSpecifiedFingerprintTLSConfig

func GetSpecifiedFingerprintTLSConfig(tlsConfig *tls.Config, fingerprint string) (*tls.Config, error)

GetSpecifiedFingerprintTLSConfig specified fingerprint

func GetSpecifiedFingerprintXTLSConfig

func GetSpecifiedFingerprintXTLSConfig(tlsConfig *xtls.Config, fingerprint string) (*xtls.Config, error)

GetSpecifiedFingerprintXTLSConfig specified fingerprint

func HaveGlobalFingerprint

func HaveGlobalFingerprint() bool

func SetGlobalUtlsClient

func SetGlobalUtlsClient(Client string)

func UClient

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

Types

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 (*UConn) WebsocketHandshake

func (c *UConn) WebsocketHandshake() error

WebsocketHandshake basically calls UConn.Handshake inside it but 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