reality

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version_x byte = 25
	Version_y byte = 5
	Version_z byte = 16
)
View Source
var File_transport_security_reality_config_proto protoreflect.FileDescriptor

Functions

func KeyLogWriterFromConfig

func KeyLogWriterFromConfig(c *RealityConfig) io.Writer

func UClient

func UClient(c net.Conn, config *RealityConfig, ctx context.Context, dest net.Destination) (net.Conn, error)

Types

type Conn

type Conn struct {
	*reality.Conn
}

func Server

func Server(c net.Conn, config *reality.Config) (*Conn, error)

func (*Conn) GetConnectionApplicationProtocol

func (c *Conn) GetConnectionApplicationProtocol() (string, error)

func (*Conn) HandshakeAddress

func (c *Conn) HandshakeAddress() net.Address

type Engine

type Engine struct {
	Config *RealityConfig
}

func NewEngine

func NewEngine(config *RealityConfig) (*Engine, error)

func (*Engine) GetClientConn

func (c *Engine) GetClientConn(conn net.Conn, opts ...security.Option) (net.Conn, error)

func (*Engine) GetTLSConfig

func (c *Engine) GetTLSConfig(_ ...security.Option) *gotls.Config

func (*Engine) Listener

func (c *Engine) Listener(l net.Listener) net.Listener

type RealityConfig

type RealityConfig struct {
	Show bool `protobuf:"varint,1,opt,name=show,proto3" json:"show,omitempty"`
	// server only
	Dest string `protobuf:"bytes,2,opt,name=dest,proto3" json:"dest,omitempty"`
	// string type = 3;
	// server only
	Xver uint64 `protobuf:"varint,4,opt,name=xver,proto3" json:"xver,omitempty"`
	// server only
	ServerNames []string `protobuf:"bytes,5,rep,name=server_names,json=serverNames,proto3" json:"server_names,omitempty"`
	// server only
	PrivateKey []byte `protobuf:"bytes,6,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	// server only
	MinClientVer []byte `protobuf:"bytes,7,opt,name=min_client_ver,json=minClientVer,proto3" json:"min_client_ver,omitempty"`
	// server only
	MaxClientVer []byte `protobuf:"bytes,8,opt,name=max_client_ver,json=maxClientVer,proto3" json:"max_client_ver,omitempty"`
	// server only
	// miliseconds
	MaxTimeDiff uint64 `protobuf:"varint,9,opt,name=max_time_diff,json=maxTimeDiff,proto3" json:"max_time_diff,omitempty"`
	// server only
	ShortIds    [][]byte `protobuf:"bytes,10,rep,name=short_ids,json=shortIds,proto3" json:"short_ids,omitempty"`
	Fingerprint string   `protobuf:"bytes,21,opt,name=Fingerprint,proto3" json:"Fingerprint,omitempty"`
	ServerName  string   `protobuf:"bytes,22,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"`
	Pbk         string   `protobuf:"bytes,28,opt,name=pbk,proto3" json:"pbk,omitempty"`
	// must be 8 bytes
	Sid          string  `protobuf:"bytes,29,opt,name=sid,proto3" json:"sid,omitempty"`
	SpiderX      string  `protobuf:"bytes,25,opt,name=spider_x,json=spiderX,proto3" json:"spider_x,omitempty"`
	MasterKeyLog string  `protobuf:"bytes,27,opt,name=master_key_log,json=masterKeyLog,proto3" json:"master_key_log,omitempty"`
	ShortId      []byte  `protobuf:"bytes,24,opt,name=short_id,json=shortId,proto3" json:"short_id,omitempty"`
	SpiderY      []int64 `protobuf:"varint,26,rep,packed,name=spider_y,json=spiderY,proto3" json:"spider_y,omitempty"`
	PublicKey    []byte  `protobuf:"bytes,23,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// contains filtered or unexported fields
}

func (*RealityConfig) Descriptor deprecated

func (*RealityConfig) Descriptor() ([]byte, []int)

Deprecated: Use RealityConfig.ProtoReflect.Descriptor instead.

func (*RealityConfig) GetDest

func (x *RealityConfig) GetDest() string

func (*RealityConfig) GetFingerprint

func (x *RealityConfig) GetFingerprint() string

func (*RealityConfig) GetMasterKeyLog

func (x *RealityConfig) GetMasterKeyLog() string

func (*RealityConfig) GetMaxClientVer

func (x *RealityConfig) GetMaxClientVer() []byte

func (*RealityConfig) GetMaxTimeDiff

func (x *RealityConfig) GetMaxTimeDiff() uint64

func (*RealityConfig) GetMinClientVer

func (x *RealityConfig) GetMinClientVer() []byte

func (*RealityConfig) GetPbk

func (x *RealityConfig) GetPbk() string

func (*RealityConfig) GetPrivateKey

func (x *RealityConfig) GetPrivateKey() []byte

func (*RealityConfig) GetPublicKey

func (x *RealityConfig) GetPublicKey() []byte

func (*RealityConfig) GetREALITYConfig

func (c *RealityConfig) GetREALITYConfig() *reality.Config

func (*RealityConfig) GetServerName

func (x *RealityConfig) GetServerName() string

func (*RealityConfig) GetServerNames

func (x *RealityConfig) GetServerNames() []string

func (*RealityConfig) GetShortId

func (x *RealityConfig) GetShortId() []byte

func (*RealityConfig) GetShortIds

func (x *RealityConfig) GetShortIds() [][]byte

func (*RealityConfig) GetShow

func (x *RealityConfig) GetShow() bool

func (*RealityConfig) GetSid

func (x *RealityConfig) GetSid() string

func (*RealityConfig) GetSpiderX

func (x *RealityConfig) GetSpiderX() string

func (*RealityConfig) GetSpiderY

func (x *RealityConfig) GetSpiderY() []int64

func (*RealityConfig) GetXver

func (x *RealityConfig) GetXver() uint64

func (*RealityConfig) ProtoMessage

func (*RealityConfig) ProtoMessage()

func (*RealityConfig) ProtoReflect

func (x *RealityConfig) ProtoReflect() protoreflect.Message

func (*RealityConfig) Reset

func (x *RealityConfig) Reset()

func (*RealityConfig) String

func (x *RealityConfig) String() string

type UConn

type UConn struct {
	*utls.UConn
	ServerName string
	// a shared secret that is used to encrypt
	AuthKey  []byte
	Verified bool
}

func (*UConn) HandshakeAddress

func (c *UConn) HandshakeAddress() net.Address

func (*UConn) VerifyPeerCertificate

func (c *UConn) VerifyPeerCertificate(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error

Jump to

Keyboard shortcuts

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