Documentation
¶
Overview ¶
Package nowhere adapts the NW3 portal to Xray's public inbound and dispatcher interfaces. It owns its TLS/QUIC listeners without Xray workers.
Index ¶
- Constants
- Variables
- func Build(info *panel.NodeInfo, tag string) (*xray.InboundHandlerConfig, error)
- func ValidateProtocol(p panel.Protocol) error
- type Account
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAlpn() string
- func (x *Config) GetCertificateFile() string
- func (x *Config) GetKeyFile() string
- func (x *Config) GetListen() string
- func (x *Config) GetMorph() bool
- func (x *Config) GetNetwork() uint32
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- type Handler
- func (h *Handler) AddUser(ctx context.Context, user *protocol.MemoryUser) error
- func (h *Handler) AddUsers(ctx context.Context, users []*protocol.MemoryUser) error
- func (h *Handler) Addr(network string) net.Addr
- func (h *Handler) Close() error
- func (h *Handler) GetUser(_ context.Context, email string) *protocol.MemoryUser
- func (h *Handler) GetUsers(context.Context) []*protocol.MemoryUser
- func (h *Handler) GetUsersCount(context.Context) int64
- func (*Handler) Network() []xnet.Network
- func (h *Handler) NewConnectionEx(ctx context.Context, conn net.Conn, source, target M.Socksaddr, ...)
- func (h *Handler) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source, target M.Socksaddr, ...)
- func (*Handler) Process(context.Context, xnet.Network, stat.Connection, routing.Dispatcher) error
- func (h *Handler) RemoveUser(ctx context.Context, email string) error
- func (h *Handler) RemoveUsers(ctx context.Context, emails []string) error
- func (h *Handler) Start() error
- func (h *Handler) String() string
Constants ¶
View Source
const ( NetworkTCP uint32 = 1 << iota NetworkQUIC NetworkMixed = NetworkTCP | NetworkQUIC ALPN = "nw3" )
Variables ¶
View Source
var File_core_protocol_nowhere_config_proto protoreflect.FileDescriptor
Functions ¶
func Build ¶
Build bypasses Xray's fixed JSON protocol-name table using our own protobuf configuration. Certificate validation happens before a running node is stopped.
func ValidateProtocol ¶
Types ¶
type Account ¶
type Account struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*Account) Descriptor
deprecated
func (*Account) ProtoMessage ¶
func (*Account) ProtoMessage()
func (*Account) ProtoReflect ¶
func (x *Account) ProtoReflect() protoreflect.Message
type Config ¶
type Config struct {
Listen string `protobuf:"bytes,1,opt,name=listen,proto3" json:"listen,omitempty"`
Network uint32 `protobuf:"varint,2,opt,name=network,proto3" json:"network,omitempty"`
CertificateFile string `protobuf:"bytes,3,opt,name=certificate_file,json=certificateFile,proto3" json:"certificate_file,omitempty"`
KeyFile string `protobuf:"bytes,4,opt,name=key_file,json=keyFile,proto3" json:"key_file,omitempty"`
Morph bool `protobuf:"varint,5,opt,name=morph,proto3" json:"morph,omitempty"`
Alpn string `protobuf:"bytes,6,opt,name=alpn,proto3" json:"alpn,omitempty"`
// contains filtered or unexported fields
}
func (*Config) Descriptor
deprecated
func (*Config) GetCertificateFile ¶
func (*Config) GetKeyFile ¶
func (*Config) GetNetwork ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a workerless Xray inbound: Morph must see raw TCP/UDP before TLS and QUIC, so the portal owns both listeners rather than using Xray transports.
func (*Handler) AddUsers ¶
AddUsers publishes a complete immutable authentication generation once per panel update, avoiding a full user-table rebuild for every individual user.
func (*Handler) NewConnectionEx ¶
func (*Handler) NewPacketConnectionEx ¶
func (h *Handler) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source, target M.Socksaddr, onClose N.CloseHandlerFunc)
func (*Handler) Process ¶
func (*Handler) Process(context.Context, xnet.Network, stat.Connection, routing.Dispatcher) error
func (*Handler) RemoveUsers ¶
Click to show internal directories.
Click to hide internal directories.