vmess

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 15 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 = errors.New("Not Found")
View Source
var ErrTainted = errors.New("ErrTainted")

Functions

This section is empty.

Types

type MemoryAccount

type MemoryAccount struct {
	UserId string
	// 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 NewMemoryAccount

func NewMemoryAccount(uid string, secret string, alterId uint16, security protocol.SecurityType,
	authLenExp, noTermi bool) *MemoryAccount

func (*MemoryAccount) AnyValidID

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

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

Equals implements protocol.Account.

type TimedUserValidator

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

TimedUserValidator is a user Validator based on time.

func NewTimedUserValidator

func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator

NewTimedUserValidator creates a new TimedUserValidator.

func (*TimedUserValidator) Add

func (*TimedUserValidator) BurnTaintFuse

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

func (*TimedUserValidator) Close

func (v *TimedUserValidator) Close() error

Close implements common.Closable.

func (*TimedUserValidator) Get

func (*TimedUserValidator) GetAEAD

func (v *TimedUserValidator) GetAEAD(userHash []byte) (*MemoryAccount, bool, error)

func (*TimedUserValidator) GetBaseTime

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

visible for testing

func (*TimedUserValidator) GetBehaviorSeed

func (v *TimedUserValidator) GetBehaviorSeed() uint64

func (*TimedUserValidator) Remove

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

func (*TimedUserValidator) RemoveByUid

func (v *TimedUserValidator) RemoveByUid(uid string) bool

func (*TimedUserValidator) ShouldShowLegacyWarn

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