vi

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = byte(0)
)

Variables

View Source
var (
	InvalidUser    = errors.New("invalid user")
	InvalidVersion = errors.New("invalid version")
)

Functions

func EncodeHeader

func EncodeHeader(version byte, credential []byte, dest net.Destination, udpUuid uuid.UUID) (*buf.Buffer, error)

EncodeHeader encodes a header into bytes.

Types

type Client

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

func NewClient

func NewClient() *Client

New creates a new VLess outbound handler.

func (*Client) HandleFlow

func (h *Client) HandleFlow(ctx context.Context, dst net.Destination, rw buf.ReaderWriter) error

Process implements proxy.Outbound.Process().

func (*Client) HandlePacketConn

func (c *Client) HandlePacketConn(ctx context.Context, dst net.Destination, pc udp.PacketReaderWriter) error

TODO

func (*Client) WithServerPicker

func (h *Client) WithServerPicker(p protocol.ServerPicker) *Client
type Header struct {
	Version byte
	User    string
	Level   uint32
	Dest    net.Destination
	UdpUuid uuid.UUID
}

func DecodeHeader

func DecodeHeader(data *buf.Buffer, um *sync.Map) (*Header, error)

type Server

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

func New

func New() *Server

New creates a new VLess inbound handler.

func (*Server) AddUser

func (h *Server) AddUser(user i.User)

func (*Server) Network

func (*Server) Network() []net.Network

Network implements proxy.Inbound.Network().

func (*Server) Process

func (h *Server) Process(ctx context.Context, conn net.Conn) error

Process implements proxy.Inbound.Process().

func (*Server) RemoveUser

func (h *Server) RemoveUser(uuid uuid.UUID)

func (*Server) WithHandler

func (s *Server) WithHandler(h i.Handler)

func (*Server) WithTimeoutPolicy

func (s *Server) WithTimeoutPolicy(policy i.TimeoutSetting)

type User

type User struct {
	Uid    string
	Secret string
}

Jump to

Keyboard shortcuts

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