Documentation
¶
Overview ¶
Package nodeagent runs the panel-managed node: it holds an outbound long-poll to the panel, applies the Xray config the panel pushes, and reports traffic back. It reuses the same building blocks as the panel (xray.Supervisor, tlsmgr, hop, connguard, decoy), so a node is the same binary in a different mode — no DB, just a small identity + state file under its data dir.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is the running node: it owns the local Xray supervisor and the decoy server, holds the long-poll to the panel, and reports traffic back.
type Identity ¶
type Identity struct {
PanelURL string `json:"panel_url"` // scheme://host of the panel
NodeAPI string `json:"node_api"` // the panel's node-API path segment
NodeID int64 `json:"node_id"`
Token string `json:"token"`
// Insecure skips TLS verification of the panel cert, for a panel without a
// CA-valid cert (IP-only / self-signed). Set from `--join --insecure`; it must
// persist so the ongoing sync uses it too, not just the one join call.
Insecure bool `json:"insecure,omitempty"`
}
Identity is the node's persisted credential + where to reach the panel. Stored 0600 as node.json in the data dir. Token is the permanent bearer credential.
func Join ¶
Join exchanges a one-time join URL (…/<node_api>/v1/join#<join_token>) for a permanent identity and persists it. insecure allows a self-signed panel cert (the panel usually has a real cert; this is an escape hatch for edge setups).
func LoadIdentity ¶
LoadIdentity reads the node's identity, or an error if the node hasn't joined.