encoding

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version = byte(0)
)

Variables

View Source
var File_proxy_vless_encoding_addons_proto protoreflect.FileDescriptor

Functions

func DecodeBodyAddons

func DecodeBodyAddons(reader io.Reader, request *protocol.RequestHeader, addons *Addons) buf.Reader

DecodeBodyAddons returns a Reader from which caller can fetch decrypted body.

func EncodeBodyAddons

func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, requestAddons *Addons, state *proxy.TrafficState, context context.Context) buf.Writer

EncodeBodyAddons returns a Writer that auto-encrypt content written by caller.

func EncodeHeaderAddons

func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error

func EncodeRequestHeader

func EncodeRequestHeader(writer io.Writer, request *protocol.RequestHeader, requestAddons *Addons) error

EncodeRequestHeader writes encoded request header into the given writer.

func EncodeResponseHeader

func EncodeResponseHeader(writer io.Writer, request *protocol.RequestHeader, responseAddons *Addons) error

EncodeResponseHeader writes encoded response header into the given writer.

func XtlsRead

func XtlsRead(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn net.Conn, input *bytes.Reader, rawInput *bytes.Buffer, trafficState *proxy.TrafficState, ctx context.Context) error

XtlsRead filter and read xtls protocol

func XtlsWrite

func XtlsWrite(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn net.Conn, trafficState *proxy.TrafficState, ctx context.Context) error

XtlsWrite filter and write xtls protocol

Types

type Addons

type Addons struct {
	Flow string `protobuf:"bytes,1,opt,name=Flow,proto3" json:"Flow,omitempty"`
	Seed []byte `protobuf:"bytes,2,opt,name=Seed,proto3" json:"Seed,omitempty"`
	// contains filtered or unexported fields
}

func DecodeHeaderAddons

func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error)

func DecodeRequestHeader

func DecodeRequestHeader(isfb bool, first *buf.Buffer, reader io.Reader, validator *vless.Validator) (*protocol.RequestHeader, *Addons, bool, error)

DecodeRequestHeader decodes and returns (if successful) a RequestHeader from an input stream.

func DecodeResponseHeader

func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*Addons, error)

DecodeResponseHeader decodes and returns (if successful) a ResponseHeader from an input stream.

func (*Addons) Descriptor deprecated

func (*Addons) Descriptor() ([]byte, []int)

Deprecated: Use Addons.ProtoReflect.Descriptor instead.

func (*Addons) GetFlow

func (x *Addons) GetFlow() string

func (*Addons) GetSeed

func (x *Addons) GetSeed() []byte

func (*Addons) ProtoMessage

func (*Addons) ProtoMessage()

func (*Addons) ProtoReflect

func (x *Addons) ProtoReflect() protoreflect.Message

func (*Addons) Reset

func (x *Addons) Reset()

func (*Addons) String

func (x *Addons) String() string

type LengthPacketReader

type LengthPacketReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func NewLengthPacketReader

func NewLengthPacketReader(reader io.Reader) *LengthPacketReader

func (*LengthPacketReader) ReadMultiBuffer

func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error)

type LengthPacketWriter

type LengthPacketWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewLengthPacketWriter

func NewLengthPacketWriter(writer io.Writer) *LengthPacketWriter

func (*LengthPacketWriter) WriteMultiBuffer

func (w *LengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error

type MultiLengthPacketWriter

type MultiLengthPacketWriter struct {
	buf.Writer
}

func NewMultiLengthPacketWriter

func NewMultiLengthPacketWriter(writer buf.Writer) *MultiLengthPacketWriter

func (*MultiLengthPacketWriter) WriteMultiBuffer

func (w *MultiLengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error

Jump to

Keyboard shortcuts

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