vless

package
v1.5.0-beta.12 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: GPL-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func EncodeRequest added in v1.3.0

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

func ReadResponse

func ReadResponse(reader io.Reader) error

func RequestLen added in v1.3.0

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

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 v1.3.0

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

func (*Conn) FrontHeadroom added in v1.3.0

func (c *Conn) FrontHeadroom() int

func (*Conn) NeedHandshake

func (c *Conn) NeedHandshake() bool

func (*Conn) Read

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

func (*Conn) ReadBuffer added in v1.3.0

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

func (*Conn) ReaderReplaceable added in v1.3.0

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 v1.3.0

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

func (*Conn) WriteVectorised added in v1.3.0

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

func (*Conn) WriterReplaceable added in v1.3.0

func (c *Conn) WriterReplaceable() bool

type Handler

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 v1.2.5

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

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

type Service

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

func NewService

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

func (*Service[T]) NewConnection

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

func (*Service[T]) UpdateUsers

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

type VisionConn

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

func NewVisionConn

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

func (*VisionConn) NeedAdditionalReadDeadline added in v1.2.5

func (c *VisionConn) NeedAdditionalReadDeadline() bool

func (*VisionConn) Read

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

func (*VisionConn) Upstream

func (c *VisionConn) Upstream() any

func (*VisionConn) Write

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