Documentation
¶
Overview ¶
Package vless is the panel half of the VLESS protocol plugin. It offers REALITY over TCP (RAW + Vision) and XHTTP, plus XHTTP+TLS and WebSocket+TLS through the node's TLS front.
Index ¶
- Constants
- type CDNSettings
- type ClientParams
- type NodeCDN
- type NodeReality
- type NodeSettings
- type NodeWebSocket
- type NodeXHTTP
- type Protocol
- func (*Protocol) BuildInbound(in protocols.InboundInput) (plugin.InboundSpec, error)
- func (*Protocol) Clients() []plugin.ClientSupport
- func (*Protocol) DefaultSettings() (json.RawMessage, error)
- func (*Protocol) DisplayName() string
- func (*Protocol) Doctor() []protocols.Check
- func (*Protocol) ID() string
- func (*Protocol) InitInbound(protocols.InboundInitInput) (protocols.InboundInit, error)
- func (*Protocol) IssueCredential(protocols.IssueInput) (protocols.Issued, error)
- func (*Protocol) NormalizeSettings(in protocols.NormalizeInput) (json.RawMessage, error)
- func (*Protocol) Render(in protocols.RenderInput) (plugin.Fragment, bool)
- func (*Protocol) SettingsSchema() []byte
- func (*Protocol) Summary(raw json.RawMessage) string
- func (*Protocol) Validate(raw json.RawMessage) []protocols.FieldError
- type RealitySettings
- type Settings
- type WSSettings
- type XHTTPSettings
Constants ¶
const ID = "vless"
ID is the plugin id.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDNSettings ¶ added in v0.1.36
type ClientParams ¶ added in v0.1.37
type ClientParams struct {
Host, UUID, Flow, Security, SNI, Fingerprint string
PublicKey, ShortID, SpiderX string
Transport, ClientHost string
XHTTPPath, XHTTPMode, XHTTPPadding string
XHTTPExtra string
WSPath string
Port uint16
ALPN []string
}
ClientParams are the effective VLESS settings a client consumes after profile and per-credential values are resolved. Both subscription renderers and the panel's synthetic client use this result.
func ResolveClientParams ¶ added in v0.1.37
func ResolveClientParams(in protocols.RenderInput) (ClientParams, bool)
ResolveClientParams checks the inputs a client link depends on and makes the per-credential picks: the REALITY server name and short id are chosen by fnv32(device id), so the bytes of a subscription stay the same from one fetch to the next. XHTTP and WebSocket ALPN follow the node's TLS front; the URI format leaves those defaults implicit.
type NodeReality ¶
type NodeSettings ¶
type NodeSettings struct {
Transport string `json:"transport"`
Security string `json:"security"`
Flow string `json:"flow"`
CDN *NodeCDN `json:"cdn,omitempty"`
Reality NodeReality `json:"reality"`
XHTTP NodeXHTTP `json:"xhttp"`
WS NodeWebSocket `json:"ws"`
}
NodeSettings is the deterministic settings_json contract consumed by internal/node/vless.parseSpec. Field order is kept in sync with the node wireSettings type.
type NodeWebSocket ¶
type Protocol ¶
type Protocol struct{}
Protocol implements protocols.Protocol, InboundInitializer and SettingsNormalizer.
func (*Protocol) BuildInbound ¶
func (*Protocol) BuildInbound(in protocols.InboundInput) (plugin.InboundSpec, error)
BuildInbound lifts the TCP listen port, TLS certificate and egress out of settings. The node receives only the origin fields needed to build the TLS front; the CDN endpoint stays in the panel profile for client rendering.
func (*Protocol) Clients ¶
func (*Protocol) Clients() []plugin.ClientSupport
func (*Protocol) DefaultSettings ¶
func (*Protocol) DefaultSettings() (json.RawMessage, error)
DefaultSettings leaves out what must differ from one profile to the next: the short ids and the XHTTP path. The panel UI keeps these defaults for the whole session, so a value drawn here would be shared by every profile made in it; NormalizeSettings draws them when a profile is made, the way the AmneziaWG plugin does for its obfuscation block.
func (*Protocol) DisplayName ¶
func (*Protocol) InitInbound ¶
func (*Protocol) InitInbound(protocols.InboundInitInput) (protocols.InboundInit, error)
InitInbound generates an X25519 REALITY key pair for this inbound. State is the private key; Public is safe to include in client configurations. The access framework parks State when an inbound is removed and restores it when that same profile is added back to the node.
func (*Protocol) IssueCredential ¶
IssueCredential makes the UUID v4 VLESS uses as both the client secret and its node-side identity.
func (*Protocol) NormalizeSettings ¶
func (*Protocol) NormalizeSettings(in protocols.NormalizeInput) (json.RawMessage, error)
NormalizeSettings draws the short ids (one of 8 and one of 16 hex characters) and the XHTTP path of a profile that has none. A document that gives a target and does not say what kind it is (a script written for the panel before the node could serve its own site) means another site, as it always did: the default "self" would otherwise drop its target in silence. It returns Merged itself when there is nothing to change.
func (*Protocol) SettingsSchema ¶
func (*Protocol) Validate ¶
func (*Protocol) Validate(raw json.RawMessage) []protocols.FieldError
type RealitySettings ¶
type RealitySettings struct {
// TargetKind is self or site. A document that predates the field (a profile made before the node could serve its own
// site) carries a target and no kind: it reads as site, see kind().
TargetKind string `json:"target_kind"`
Target string `json:"target"`
ServerNames []string `json:"server_names"`
ShortIDs []string `json:"short_ids"`
Fingerprint string `json:"fingerprint"`
}
type Settings ¶
type Settings struct {
Port int `json:"port"`
Transport string `json:"transport"`
Security string `json:"security"`
TLSMode string `json:"tls_mode,omitempty"`
SNI string `json:"sni,omitempty"`
CDN *CDNSettings `json:"cdn,omitempty"`
Reality RealitySettings `json:"reality"`
XHTTP XHTTPSettings `json:"xhttp"`
WS *WSSettings `json:"ws,omitempty"`
Egress string `json:"egress"`
}
Settings is the merged profile settings document. Private keys are per inbound and never live here.