vless

package
v0.1.35 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const ID = "vless"

ID is the plugin id.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeReality

type NodeReality struct {
	Target      string   `json:"target"`
	ServerNames []string `json:"server_names"`
	ShortIDs    []string `json:"short_ids"`
	PrivateKey  string   `json:"private_key"`
}

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 NodeWebSocket struct {
	Path string `json:"path"`
	Host string `json:"host"`
}

type NodeXHTTP

type NodeXHTTP struct {
	Path          string `json:"path"`
	Host          string `json:"host"`
	Mode          string `json:"mode"`
	XPaddingBytes string `json:"x_padding_bytes"`
}

type Protocol

type Protocol struct{}

Protocol implements protocols.Protocol, InboundInitializer and SettingsNormalizer.

func New

func New() *Protocol

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) DisplayName() string

func (*Protocol) Doctor

func (*Protocol) Doctor() []protocols.Check

func (*Protocol) ID

func (*Protocol) ID() string

func (*Protocol) InitInbound

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

func (*Protocol) IssueCredential(protocols.IssueInput) (protocols.Issued, error)

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

func (*Protocol) SettingsSchema

func (*Protocol) SettingsSchema() []byte

func (*Protocol) Summary

func (*Protocol) Summary(raw json.RawMessage) string

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.

type XHTTPSettings

type XHTTPSettings struct {
	Path          string `json:"path"`
	Host          string `json:"host"`
	Mode          string `json:"mode"`
	XPaddingBytes string `json:"x_padding_bytes"`
}

Jump to

Keyboard shortcuts

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