Documentation
¶
Overview ¶
Package vless is the panel half of the VLESS protocol plugin. It offers REALITY over TCP (RAW + Vision) and XHTTP, with the node's own site as the target ("self", the default) or another site. TLS, WebSocket and the CDN fields come with the node's TLS front: the schema does not list them and Validate refuses them, so the node never sees a spec it cannot serve.
Index ¶
- Constants
- 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 XHTTPSettings
Constants ¶
const ID = "vless"
ID is the plugin id.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeReality ¶
type NodeSettings ¶
type NodeSettings struct {
Transport string `json:"transport"`
Security string `json:"security"`
Flow string `json:"flow"`
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 and egress out of settings. The rest is the node's vless wireSettings. The node's own site as the target (the default) also asks for a Let's Encrypt certificate for the site's name: TLS acme_domain.
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"`
Reality RealitySettings `json:"reality"`
XHTTP XHTTPSettings `json:"xhttp"`
Egress string `json:"egress"`
}
Settings is the merged profile settings document. Private keys are per inbound and never live here.