Documentation
¶
Overview ¶
Package node runs lantern-box as a Lantern node whose config comes from lantern-cloud: it registers through the peer API Share My Connection uses, serves the config it gets back, proves to lantern-cloud that its inbound is reachable, keeps the route alive with heartbeats, and registers again on a fixed interval for fresh credentials and settings.
Index ¶
Constants ¶
View Source
const ( // DefaultRotationInterval matches Share My Connection's credential // rotation. Each rotation also picks up lantern-cloud's current settings, // such as the volunteer's discovery server and tuning, so it bounds how // stale they can get. DefaultRotationInterval = time.Hour )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// APIURL is lantern-cloud's API base URL, with its version segment.
APIURL string
// StateDir holds the node's device ID and port across restarts.
StateDir string
// Port, when set, replaces the port kept in StateDir, for an operator who
// forwards a specific port.
Port uint16
// UserID is the operator's Lantern user ID, which the unbounded feature
// flag can enroll.
UserID string
// FeatureOverrides is sent as X-Lantern-Feature-Override, for staging.
FeatureOverrides string
// MaxPeers and BandwidthLimit are the operator's limits for the
// Unbounded volunteer service, applied to whatever lantern-cloud sends.
MaxPeers int
BandwidthLimit string
// RotationInterval is how often the node registers again. Zero means
// DefaultRotationInterval.
RotationInterval time.Duration
// Version is reported to lantern-cloud.
Version string
HTTPClient *http.Client
}
Config configures a node.
Click to show internal directories.
Click to hide internal directories.