vless

package
v24.12.6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package vless contains the implementation of VLess protocol and transportation.

VLess contains both inbound and outbound connections. VLess inbound is usually used on servers together with 'freedom' to talk to final destination, while VLess outbound is usually used on clients with 'socks' for proxying.

Index

Constants

View Source
const (
	XRV = "xtls-rprx-vision"
)

Variables

View Source
var File_proxy_vless_account_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Account

type Account struct {

	// ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57".
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Flow settings. May be "xtls-rprx-vision".
	Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"`
	// Encryption settings. Only applies to client side, and only accepts "none" for now.
	Encryption string `protobuf:"bytes,3,opt,name=encryption,proto3" json:"encryption,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) AsAccount

func (a *Account) AsAccount() (protocol.Account, error)

AsAccount implements protocol.Account.AsAccount().

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetEncryption

func (x *Account) GetEncryption() string

func (*Account) GetFlow

func (x *Account) GetFlow() string

func (*Account) GetId

func (x *Account) GetId() string

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

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

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

type MemoryAccount

type MemoryAccount struct {
	// ID of the account.
	ID *protocol.ID
	// Flow of the account. May be "xtls-rprx-vision".
	Flow string
	// Encryption of the account. Used for client connections, and only accepts "none" for now.
	Encryption string
}

MemoryAccount is an in-memory form of VLess account.

func (*MemoryAccount) Equals

func (a *MemoryAccount) Equals(account protocol.Account) bool

Equals implements protocol.Account.Equals().

func (*MemoryAccount) ToProto

func (a *MemoryAccount) ToProto() proto.Message

type MemoryValidator

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

MemoryValidator stores valid VLESS users.

func (*MemoryValidator) Add

Add a VLESS user, Email must be empty or unique.

func (*MemoryValidator) Del

func (v *MemoryValidator) Del(e string) error

Del a VLESS user with a non-empty Email.

func (*MemoryValidator) Get

Get a VLESS user with UUID, nil if user doesn't exist.

func (*MemoryValidator) GetAll

func (v *MemoryValidator) GetAll() []*protocol.MemoryUser

Get all users

func (*MemoryValidator) GetByEmail

func (v *MemoryValidator) GetByEmail(email string) *protocol.MemoryUser

Get a VLESS user with email, nil if user doesn't exist.

func (*MemoryValidator) GetCount

func (v *MemoryValidator) GetCount() int64

Get users count

type Validator

type Validator interface {
	Get(id uuid.UUID) *protocol.MemoryUser
	Add(u *protocol.MemoryUser) error
	Del(email string) error
	GetByEmail(email string) *protocol.MemoryUser
	GetAll() []*protocol.MemoryUser
	GetCount() int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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