vless

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: GPL-2.0 Imports: 23 Imported by: 7

Documentation

Index

Constants

View Source
const (
	Version    = 0
	FlowVision = "xtls-rprx-vision"
)

Variables

This section is empty.

Functions

func EncodeRequest added in v0.1.9

func EncodeRequest(request Request, buffer *buf.Buffer) error

func ReadResponse

func ReadResponse(reader io.Reader) error

func RequestLen added in v0.1.9

func RequestLen(request Request) int

func WritePacketRequest

func WritePacketRequest(writer io.Writer, request Request, payload []byte) error

func WriteRequest

func WriteRequest(writer io.Writer, request Request, payload []byte) error

Types

type Addons added in v0.1.9

type Addons struct {
	Flow string
	Seed string
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(userId string, flow string, logger logger.Logger) (*Client, error)

func (*Client) DialConn

func (c *Client) DialConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error)

func (*Client) DialEarlyConn

func (c *Client) DialEarlyConn(conn net.Conn, destination M.Socksaddr) (net.Conn, error)

func (*Client) DialEarlyPacketConn

func (c *Client) DialEarlyPacketConn(conn net.Conn, destination M.Socksaddr) (*PacketConn, error)

func (*Client) DialEarlyXUDPPacketConn

func (c *Client) DialEarlyXUDPPacketConn(conn net.Conn, destination M.Socksaddr) (vmess.PacketConn, error)

func (*Client) DialPacketConn

func (c *Client) DialPacketConn(conn net.Conn, destination M.Socksaddr) (*PacketConn, error)

func (*Client) DialXUDPPacketConn

func (c *Client) DialXUDPPacketConn(conn net.Conn, destination M.Socksaddr) (vmess.PacketConn, error)

type Conn

type Conn struct {
	N.ExtendedConn
	// contains filtered or unexported fields
}

func NewConn added in v0.1.9

func NewConn(conn net.Conn, uuid [16]byte, command byte, destination M.Socksaddr, flow string) *Conn

func (*Conn) FrontHeadroom added in v0.1.9

func (c *Conn) FrontHeadroom() int

func (*Conn) NeedAdditionalReadDeadline added in v0.1.12

func (c *Conn) NeedAdditionalReadDeadline() bool

func (*Conn) NeedHandshake added in v0.1.9

func (c *Conn) NeedHandshake() bool

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) ReadBuffer added in v0.1.9

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

func (*Conn) ReaderReplaceable added in v0.1.9

func (c *Conn) ReaderReplaceable() bool

func (*Conn) Upstream

func (c *Conn) Upstream() any

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

func (*Conn) WriteBuffer added in v0.1.9

func (c *Conn) WriteBuffer(buffer *buf.Buffer) error

func (*Conn) WriteVectorised added in v0.1.9

func (c *Conn) WriteVectorised(buffers []*buf.Buffer) error

func (*Conn) WriterReplaceable added in v0.1.9

func (c *Conn) WriterReplaceable() bool

type Handler added in v0.1.9

type Handler interface {
	N.TCPConnectionHandler
	N.UDPConnectionHandler
	E.Handler
}

type PacketConn

type PacketConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*PacketConn) FrontHeadroom

func (c *PacketConn) FrontHeadroom() int

func (*PacketConn) NeedAdditionalReadDeadline added in v0.1.9

func (c *PacketConn) NeedAdditionalReadDeadline() bool

func (*PacketConn) Read

func (c *PacketConn) Read(b []byte) (n int, err error)

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*PacketConn) Upstream

func (c *PacketConn) Upstream() any

func (*PacketConn) Write

func (c *PacketConn) Write(b []byte) (n int, err error)

func (*PacketConn) WritePacket

func (c *PacketConn) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)

type Request

type Request struct {
	UUID        [16]byte
	Command     byte
	Destination M.Socksaddr
	Flow        string
}

func ReadRequest added in v0.1.9

func ReadRequest(reader io.Reader) (*Request, error)

type Service added in v0.1.9

type Service[T comparable] struct {
	// contains filtered or unexported fields
}

func NewService added in v0.1.9

func NewService[T comparable](logger logger.Logger, handler Handler) *Service[T]

func (*Service[T]) NewConnection added in v0.1.9

func (s *Service[T]) NewConnection(ctx context.Context, conn net.Conn, metadata M.Metadata) error

func (*Service[T]) UpdateUsers added in v0.1.9

func (s *Service[T]) UpdateUsers(userList []T, userUUIDList []string, userFlowList []string)

type VisionConn added in v0.1.9

type VisionConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewVisionConn added in v0.1.9

func NewVisionConn(conn net.Conn, tlsConn net.Conn, userUUID [16]byte, logger logger.Logger) (*VisionConn, error)

func (*VisionConn) NeedAdditionalReadDeadline added in v0.1.9

func (c *VisionConn) NeedAdditionalReadDeadline() bool

func (*VisionConn) Read added in v0.1.9

func (c *VisionConn) Read(p []byte) (n int, err error)

func (*VisionConn) Upstream added in v0.1.9

func (c *VisionConn) Upstream() any

func (*VisionConn) Write added in v0.1.9

func (c *VisionConn) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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