inbound

package
v1.0.1-0...-9165f85 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proxy_vmess_inbound_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Config

type Config struct {
	User    []*protocol.User `protobuf:"bytes,1,rep,name=user,proto3" json:"user,omitempty"`
	Default *DefaultConfig   `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"`
	Detour  *DetourConfig    `protobuf:"bytes,3,opt,name=detour,proto3" json:"detour,omitempty"` // 4 is for legacy setting
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetDefault

func (x *Config) GetDefault() *DefaultConfig

func (*Config) GetDefaultValue

func (c *Config) GetDefaultValue() *DefaultConfig

GetDefaultValue returns default settings of DefaultConfig.

func (*Config) GetDetour

func (x *Config) GetDetour() *DetourConfig

func (*Config) GetUser

func (x *Config) GetUser() []*protocol.User

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type DefaultConfig

type DefaultConfig struct {
	Level uint32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
	// contains filtered or unexported fields
}

func (*DefaultConfig) Descriptor deprecated

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

Deprecated: Use DefaultConfig.ProtoReflect.Descriptor instead.

func (*DefaultConfig) GetLevel

func (x *DefaultConfig) GetLevel() uint32

func (*DefaultConfig) ProtoMessage

func (*DefaultConfig) ProtoMessage()

func (*DefaultConfig) ProtoReflect

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

func (*DefaultConfig) Reset

func (x *DefaultConfig) Reset()

func (*DefaultConfig) String

func (x *DefaultConfig) String() string

type DetourConfig

type DetourConfig struct {
	To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

func (*DetourConfig) Descriptor deprecated

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

Deprecated: Use DetourConfig.ProtoReflect.Descriptor instead.

func (*DetourConfig) GetTo

func (x *DetourConfig) GetTo() string

func (*DetourConfig) ProtoMessage

func (*DetourConfig) ProtoMessage()

func (*DetourConfig) ProtoReflect

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

func (*DetourConfig) Reset

func (x *DetourConfig) Reset()

func (*DetourConfig) String

func (x *DetourConfig) String() string

type Handler

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

Handler is an inbound connection handler that handles messages in VMess protocol.

func New

func New(ctx context.Context, config *Config) (*Handler, error)

New creates a new VMess inbound handler.

func (*Handler) AddUser

func (h *Handler) AddUser(ctx context.Context, user *protocol.MemoryUser) error

func (*Handler) Close

func (h *Handler) Close() error

Close implements common.Closable.

func (*Handler) GetOrGenerateUser

func (h *Handler) GetOrGenerateUser(email string) *protocol.MemoryUser

func (*Handler) GetUser

func (h *Handler) GetUser(ctx context.Context, email string) *protocol.MemoryUser

func (*Handler) GetUsers

func (h *Handler) GetUsers(ctx context.Context) []*protocol.MemoryUser

func (*Handler) GetUsersCount

func (h *Handler) GetUsersCount(context.Context) int64

func (*Handler) Network

func (*Handler) Network() []net.Network

Network implements proxy.Inbound.Network().

func (*Handler) Process

func (h *Handler) Process(ctx context.Context, network net.Network, connection stat.Connection, dispatcher routing.Dispatcher) error

Process implements proxy.Inbound.Process().

func (*Handler) RemoveUser

func (h *Handler) RemoveUser(ctx context.Context, email string) error

Jump to

Keyboard shortcuts

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