vless

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = 0

	AddrTypeIPv4   = 1
	AddrTypeDomain = 2
	AddrTypeIPv6   = 3

	TCP = protocol.RequestCommandTCP // 0x01
	UDP = protocol.RequestCommandUDP // 0x02
	MUX = protocol.RequestCommandMux // 0x03
)

Variables

This section is empty.

Functions

func NewHTTPHandler

func NewHTTPHandler(opts ...Option) http.Handler

NewHTTPHandler create handle over http

Types

type Handler

type Handler interface {
	Handle(ctx context.Context, connect io.ReadWriteCloser) error
}

func NewHandler

func NewHandler(opts ...Option) Handler

type Option

type Option func(*handler)

func WithDial

func WithDial(dialer net.Dialer) Option

func WithPostHandle

func WithPostHandle(postHandle func(ctx context.Context, request Requester, upBytes, downBytes int64, err error)) Option

func WithPreHandle

func WithPreHandle(preHand func(ctx context.Context, request Requester) error) Option

type Requester

type Requester interface {
	Version() byte
	UUID() uuid.UUID
	Addons() []byte
	Command() protocol.RequestCommand
	DestAddr() string
}

type Response

type Response struct {
	Version byte
	Addons  []byte
}

func (*Response) WriteTo

func (r *Response) WriteTo(w io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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