vision

package
v1.19.0 Latest Latest
Warning

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

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

Documentation

Overview

Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core.

Index

Constants

View Source
const (
	PaddingHeaderLen = uuid.Size + 1 + 2 + 2 // =21

)

Variables

View Source
var ErrNotTLS13 = errors.New("XTLS Vision based on TLS 1.3 outer connection")

Functions

func ApplyPadding

func ApplyPadding(buffer *buf.Buffer, command byte, userUUID *uuid.UUID, paddingTLS bool)

func ReshapeBuffer

func ReshapeBuffer(buffer *buf.Buffer) *buf.Buffer

func WriteWithPadding

func WriteWithPadding(buffer *buf.Buffer, p []byte, command byte, userUUID *uuid.UUID, paddingTLS bool)

Types

type Conn

type Conn struct {
	net.Conn
	N.ExtendedReader
	N.ExtendedWriter
	// contains filtered or unexported fields
}

func NewConn

func NewConn(conn connWithUpstream, userUUID *uuid.UUID) (*Conn, error)

func (*Conn) FilterTLS

func (vc *Conn) FilterTLS(buffer []byte) (index int)

func (*Conn) FrontHeadroom

func (vc *Conn) FrontHeadroom() int

func (*Conn) NeedHandshake

func (vc *Conn) NeedHandshake() bool

func (*Conn) Read

func (vc *Conn) Read(b []byte) (int, error)

func (*Conn) ReadBuffer

func (vc *Conn) ReadBuffer(buffer *buf.Buffer) error

func (*Conn) ReaderPossiblyReplaceable

func (vc *Conn) ReaderPossiblyReplaceable() bool

func (*Conn) ReaderReplaceable

func (vc *Conn) ReaderReplaceable() bool

func (*Conn) RearHeadroom added in v1.18.0

func (vc *Conn) RearHeadroom() int

func (*Conn) Upstream

func (vc *Conn) Upstream() any

func (*Conn) Write

func (vc *Conn) Write(p []byte) (int, error)

func (*Conn) WriteBuffer

func (vc *Conn) WriteBuffer(buffer *buf.Buffer) (err error)

func (*Conn) WriterPossiblyReplaceable

func (vc *Conn) WriterPossiblyReplaceable() bool

func (*Conn) WriterReplaceable

func (vc *Conn) WriterReplaceable() bool

Jump to

Keyboard shortcuts

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