vmess

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package vmess contains the implementation of VMess protocol and transportation.

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

Index

Constants

View Source
const AlterID = "VMessCtxInterface_AlterID"

example

Variables

View Source
var ErrNotFound = newError("Not Found")
View Source
var ErrTainted = newError("ErrTainted")
View Source
var File_proxy_vmess_account_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Account added in v1.0.0

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"`
	// Number of alternative IDs. Client and server must share the same number.
	AlterId uint32 `protobuf:"varint,2,opt,name=alter_id,json=alterId,proto3" json:"alter_id,omitempty"`
	// Security settings. Only applies to client side.
	SecuritySettings *protocol.SecurityConfig `protobuf:"bytes,3,opt,name=security_settings,json=securitySettings,proto3" json:"security_settings,omitempty"`
	// Define tests enabled for this account
	TestsEnabled string `protobuf:"bytes,4,opt,name=tests_enabled,json=testsEnabled,proto3" json:"tests_enabled,omitempty"`
	// contains filtered or unexported fields
}

func (*Account) AsAccount added in v1.0.0

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

AsAccount implements protocol.Account.

func (*Account) Descriptor deprecated added in v1.0.0

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetAlterId added in v1.0.0

func (x *Account) GetAlterId() uint32

func (*Account) GetId added in v1.0.0

func (x *Account) GetId() string

func (*Account) GetSecuritySettings added in v1.0.0

func (x *Account) GetSecuritySettings() *protocol.SecurityConfig

func (*Account) GetTestsEnabled added in v1.0.0

func (x *Account) GetTestsEnabled() string

func (*Account) ProtoMessage added in v1.0.0

func (*Account) ProtoMessage()

func (*Account) ProtoReflect added in v1.0.0

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

func (*Account) Reset added in v1.0.0

func (x *Account) Reset()

func (*Account) String added in v1.0.0

func (x *Account) String() string

type MemoryAccount added in v1.0.0

type MemoryAccount struct {
	// ID is the main ID of the account.
	ID *protocol.ID
	// AlterIDs are the alternative IDs of the account.
	AlterIDs []*protocol.ID
	// Security type of the account. Used for client connections.
	Security protocol.SecurityType

	AuthenticatedLengthExperiment bool
	NoTerminationSignal           bool
}

MemoryAccount is an in-memory form of VMess account.

func (*MemoryAccount) AnyValidID added in v1.0.0

func (a *MemoryAccount) AnyValidID() *protocol.ID

AnyValidID returns an ID that is either the main ID or one of the alternative IDs if any.

func (*MemoryAccount) Equals added in v1.0.0

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

Equals implements protocol.Account.

type TimedUserValidator added in v1.0.0

type TimedUserValidator struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TimedUserValidator is a user Validator based on time.

func NewTimedUserValidator added in v1.0.0

func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator

NewTimedUserValidator creates a new TimedUserValidator.

func (*TimedUserValidator) Add added in v1.0.0

func (*TimedUserValidator) BurnTaintFuse added in v1.0.0

func (v *TimedUserValidator) BurnTaintFuse(userHash []byte) error

func (*TimedUserValidator) Close added in v1.0.0

func (v *TimedUserValidator) Close() error

Close implements common.Closable.

func (*TimedUserValidator) Get added in v1.0.0

func (*TimedUserValidator) GetAEAD added in v1.0.0

func (v *TimedUserValidator) GetAEAD(userHash []byte) (*protocol.MemoryUser, bool, error)

func (*TimedUserValidator) GetBaseTime added in v1.0.0

func (v *TimedUserValidator) GetBaseTime() protocol.Timestamp

visible for testing

func (*TimedUserValidator) GetBehaviorSeed added in v1.0.0

func (v *TimedUserValidator) GetBehaviorSeed() uint64

func (*TimedUserValidator) Remove added in v1.0.0

func (v *TimedUserValidator) Remove(email string) bool

func (*TimedUserValidator) ShouldShowLegacyWarn added in v1.0.0

func (v *TimedUserValidator) ShouldShowLegacyWarn() bool
ShouldShowLegacyWarn will return whether a Legacy Warning should be shown

Not guaranteed to only return true once for every inbound, but it is okay.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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