nowhere

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MPL-2.0 Imports: 40 Imported by: 0

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

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

func Build(info *panel.NodeInfo, tag string) (*xray.InboundHandlerConfig, error)

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

func ValidateProtocol(p panel.Protocol) error

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) AsAccount

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

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetKey

func (x *Account) GetKey() 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 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) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetAlpn

func (x *Config) GetAlpn() string

func (*Config) GetCertificateFile

func (x *Config) GetCertificateFile() string

func (*Config) GetKeyFile

func (x *Config) GetKeyFile() string

func (*Config) GetListen

func (x *Config) GetListen() string

func (*Config) GetMorph

func (x *Config) GetMorph() bool

func (*Config) GetNetwork

func (x *Config) GetNetwork() uint32

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 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) AddUser

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

func (*Handler) AddUsers

func (h *Handler) AddUsers(ctx context.Context, users []*protocol.MemoryUser) error

AddUsers publishes a complete immutable authentication generation once per panel update, avoiding a full user-table rebuild for every individual user.

func (*Handler) Addr

func (h *Handler) Addr(network string) net.Addr

Addr is the bound carrier address, useful when port zero was requested.

func (*Handler) Close

func (h *Handler) Close() error

func (*Handler) GetUser

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

func (*Handler) GetUsers

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

func (*Handler) GetUsersCount

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

func (*Handler) Network

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

func (*Handler) NewConnectionEx

func (h *Handler) NewConnectionEx(ctx context.Context, conn net.Conn, source, target M.Socksaddr, onClose N.CloseHandlerFunc)

func (*Handler) NewPacketConnectionEx

func (h *Handler) NewPacketConnectionEx(ctx context.Context, conn N.PacketConn, source, target M.Socksaddr, onClose N.CloseHandlerFunc)

func (*Handler) RemoveUser

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

func (*Handler) RemoveUsers

func (h *Handler) RemoveUsers(ctx context.Context, emails []string) error

func (*Handler) Start

func (h *Handler) Start() error

func (*Handler) String

func (h *Handler) String() string

Jump to

Keyboard shortcuts

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