Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeBodyAddons(reader io.Reader, request *protocol.RequestHeader, addons *Addons) buf.Reader
- func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons *Addons) buf.Writer
- func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error
- func EncodeRequestHeader(writer io.Writer, request *protocol.RequestHeader, requestAddons *Addons) error
- func EncodeResponseHeader(writer io.Writer, request *protocol.RequestHeader, responseAddons *Addons) error
- func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBuffer
- func XtlsFilterTls(buffer buf.MultiBuffer, numberOfPacketToFilter *int, enableXtls *bool, ...)
- func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool, ...) *buf.Buffer
- func XtlsRead(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, ...) error
- func XtlsUnpadding(ctx context.Context, buffer buf.MultiBuffer, userUUID []byte, ...) buf.MultiBuffer
- func XtlsWrite(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, ...) error
- type Addons
- func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error)
- func DecodeRequestHeader(isfb bool, first *buf.Buffer, reader io.Reader, validator *vless.Validator) (*protocol.RequestHeader, *Addons, bool, error)
- func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*Addons, error)
- type LengthPacketReader
- type LengthPacketWriter
- type MultiLengthPacketWriter
Constants ¶
const ( CommandPaddingContinue byte = 0x00 CommandPaddingEnd byte = 0x01 CommandPaddingDirect byte = 0x02 )
const (
Version = byte(0)
)
Variables ¶
var File_proxy_vless_encoding_addons_proto protoreflect.FileDescriptor
var (
Tls13CipherSuiteDic = map[uint16]string{
0x1301: "TLS_AES_128_GCM_SHA256",
0x1302: "TLS_AES_256_GCM_SHA384",
0x1303: "TLS_CHACHA20_POLY1305_SHA256",
0x1304: "TLS_AES_128_CCM_SHA256",
0x1305: "TLS_AES_128_CCM_8_SHA256",
}
)
Functions ¶
func DecodeBodyAddons ¶
DecodeBodyAddons returns a Reader from which caller can fetch decrypted body.
func EncodeBodyAddons ¶
EncodeBodyAddons returns a Writer that auto-encrypt content written by caller.
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 ReshapeMultiBuffer ¶
func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBuffer
ReshapeMultiBuffer prepare multi buffer for padding stucture (max 21 bytes)
func XtlsFilterTls ¶
func XtlsFilterTls(buffer buf.MultiBuffer, numberOfPacketToFilter *int, enableXtls *bool, isTLS12orAbove *bool, isTLS *bool, cipher *uint16, remainingServerHello *int32, ctx context.Context, )
XtlsFilterTls filter and recognize tls 1.3 and other info
func XtlsPadding ¶
func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool, ctx context.Context) *buf.Buffer
XtlsPadding add padding to eliminate length siganature during tls handshake
func XtlsRead ¶
func XtlsRead(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn net.Conn, rawConn syscall.RawConn, input *bytes.Reader, rawInput *bytes.Buffer, counter stats.Counter, ctx context.Context, userUUID []byte, numberOfPacketToFilter *int, enableXtls *bool, isTLS12orAbove *bool, isTLS *bool, cipher *uint16, remainingServerHello *int32, ) error
XtlsRead filter and read xtls protocol
func XtlsUnpadding ¶
func XtlsUnpadding(ctx context.Context, buffer buf.MultiBuffer, userUUID []byte, remainingContent *int32, remainingPadding *int32, currentCommand *int) buf.MultiBuffer
XtlsUnpadding remove padding and parse command
func XtlsWrite ¶
func XtlsWrite(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn net.Conn, counter stats.Counter, ctx context.Context, numberOfPacketToFilter *int, enableXtls *bool, isTLS12orAbove *bool, isTLS *bool, cipher *uint16, remainingServerHello *int32, ) 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 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 ¶
DecodeResponseHeader decodes and returns (if successful) a ResponseHeader from an input stream.
func (*Addons) Descriptor
deprecated
func (*Addons) ProtoMessage ¶
func (*Addons) ProtoMessage()
func (*Addons) ProtoReflect ¶
func (x *Addons) ProtoReflect() protoreflect.Message
type LengthPacketReader ¶
func NewLengthPacketReader ¶
func NewLengthPacketReader(reader io.Reader) *LengthPacketReader
func (*LengthPacketReader) ReadMultiBuffer ¶
func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error)
type LengthPacketWriter ¶
func NewLengthPacketWriter ¶
func NewLengthPacketWriter(writer io.Writer) *LengthPacketWriter
func (*LengthPacketWriter) WriteMultiBuffer ¶
func (w *LengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error
type MultiLengthPacketWriter ¶
func NewMultiLengthPacketWriter ¶
func NewMultiLengthPacketWriter(writer buf.Writer) *MultiLengthPacketWriter
func (*MultiLengthPacketWriter) WriteMultiBuffer ¶
func (w *MultiLengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error