Documentation
¶
Overview ¶
Package agent runs a mesh node: it enrolls with the coordinator, keeps the WireGuard engine in sync with the netmap and serves the local API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
CoordinatorURL string
// AuthKey enrolls the node if it is not registered yet (or its token was
// revoked). It may be empty for an already-registered node.
AuthKey string
Hostname string
StateDir string
ListenPort uint16
Interface string
AdvertiseEndpoints []netip.AddrPort
// AdvertisePublicPorts are UDP ports forwarded to this node on a router
// with a changing public IP; they are advertised with the current public
// address as STUN reports it.
AdvertisePublicPorts []uint16
// Userspace runs WireGuard over an in-process network stack instead of
// a kernel TUN interface: no root or NET_ADMIN needed, but programs reach
// the mesh only through the SOCKS5 proxy.
Userspace bool
// SOCKS5 is the listen address of the SOCKS5 proxy into the mesh;
// empty disables it.
SOCKS5 string
// AdvertiseRoutes are subnets this node offers to forward to; with
// AdvertiseExitNode it also offers to forward to the internet. Both need
// approval (by an admin or the policy) and TUN mode on Linux.
AdvertiseRoutes []netip.Prefix
AdvertiseExitNode bool
// AcceptRoutes installs other nodes' approved subnet routes.
AcceptRoutes bool
// ExitNode names a peer (by name or mesh IP) to send internet traffic
// through.
ExitNode string
// AcceptDNS points the OS resolver at MagicDNS for mesh names and split
// DNS domains (TUN mode).
AcceptDNS bool
Log *slog.Logger
}
Options configures the agent.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package controlclient talks to the coordinator's control service.
|
Package controlclient talks to the coordinator's control service. |
|
Package engine owns the WireGuard device and keeps it in sync with the netmap pushed by the coordinator.
|
Package engine owns the WireGuard device and keeps it in sync with the netmap pushed by the coordinator. |
|
Package localapi is the agent's local control socket, used by the CLI.
|
Package localapi is the agent's local control socket, used by the CLI. |
|
Package magicdns is the agent's DNS resolver.
|
Package magicdns is the agent's DNS resolver. |
|
Package magicsock is a WireGuard conn.Bind that finds the best path to each peer.
|
Package magicsock is a WireGuard conn.Bind that finds the best path to each peer. |
|
Package netcfg creates the TUN device and configures it at the OS level.
|
Package netcfg creates the TUN device and configures it at the OS level. |
|
Package pingsvc implements a tiny UDP echo protocol used by `transporter ping` to measure round trips through the mesh without needing raw sockets or root.
|
Package pingsvc implements a tiny UDP echo protocol used by `transporter ping` to measure round trips through the mesh without needing raw sockets or root. |
|
Package service installs the agent as a system service: a systemd unit on Linux, a launchd daemon on macOS, a Windows service elsewhere.
|
Package service installs the agent as a system service: a systemd unit on Linux, a launchd daemon on macOS, a Windows service elsewhere. |
|
Package socks5 is a minimal SOCKS5 server (RFC 1928): CONNECT only, no authentication.
|
Package socks5 is a minimal SOCKS5 server (RFC 1928): CONNECT only, no authentication. |
|
Package state persists the agent's identity between runs.
|
Package state persists the agent's identity between runs. |
|
Package tundev wraps the TUN device between the OS (or netstack) and WireGuard.
|
Package tundev wraps the TUN device between the OS (or netstack) and WireGuard. |
Click to show internal directories.
Click to hide internal directories.