Documentation
¶
Overview ¶
Package proxy runs a NetBird proxy server. It attempts to do everything it needs to do within the context of a single request to the server to try to reduce the amount of concurrency coordination that is required. However, it does run two additional routines in an error group for handling updates from the management server and running a separate HTTP server to handle ACME HTTP-01 challenges (if configured).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTrustedProxies ¶
ParseTrustedProxies parses a comma-separated list of CIDR prefixes or bare IPs into a slice of netip.Prefix values suitable for trusted proxy configuration. Bare IPs are converted to single-host prefixes (/32 or /128).
Types ¶
type Server ¶
type Server struct {
ID string
Logger *log.Logger
Version string
ProxyURL string
ManagementAddress string
CertificateDirectory string
CertificateFile string
CertificateKeyFile string
GenerateACMECertificates bool
ACMEChallengeAddress string
ACMEDirectory string
// ACMEChallengeType specifies the ACME challenge type: "http-01" or "tls-alpn-01".
// Defaults to "tls-alpn-01" if not specified.
ACMEChallengeType string
// CertLockMethod controls how ACME certificate locks are coordinated
// across replicas. Default: CertLockAuto (detect environment).
CertLockMethod acme.CertLockMethod
OIDCClientId string
OIDCClientSecret string
OIDCEndpoint string
OIDCScopes []string
// DebugEndpointEnabled enables the debug HTTP endpoint.
DebugEndpointEnabled bool
// DebugEndpointAddress is the address for the debug HTTP endpoint (default: ":8444").
DebugEndpointAddress string
// HealthAddress is the address for the health probe endpoint (default: "localhost:8080").
HealthAddress string
// ProxyToken is the access token for authenticating with the management server.
ProxyToken string
// ForwardedProto overrides the X-Forwarded-Proto value sent to backends.
// Valid values: "auto" (detect from TLS), "http", "https".
ForwardedProto string
// TrustedProxies is a list of IP prefixes for trusted upstream proxies.
// When set, forwarding headers from these sources are preserved and
// appended to instead of being stripped.
TrustedProxies []netip.Prefix
// WireguardPort is the port for the WireGuard interface. Use 0 for a
// random OS-assigned port. A fixed port only works with single-account
// deployments; multiple accounts will fail to bind the same port.
WireguardPort int
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package auth contains exported proxy auth values.
|
Package auth contains exported proxy auth values. |
|
cmd
|
|
|
proxy
command
|
|
|
internal
|
|
|
certwatch
Package certwatch watches TLS certificate files on disk and provides a hot-reloading GetCertificate callback for tls.Config.
|
Package certwatch watches TLS certificate files on disk and provides a hot-reloading GetCertificate callback for tls.Config. |
|
debug
Package debug provides HTTP debug endpoints and CLI client for the proxy server.
|
Package debug provides HTTP debug endpoints and CLI client for the proxy server. |
|
flock
Package flock provides best-effort advisory file locking using flock(2).
|
Package flock provides best-effort advisory file locking using flock(2). |
|
grpc
Package grpc provides gRPC utilities for the proxy client.
|
Package grpc provides gRPC utilities for the proxy client. |
|
health
Package health provides health probes for the proxy server.
|
Package health provides health probes for the proxy server. |
|
k8s
Package k8s provides a lightweight Kubernetes API client for coordination Leases.
|
Package k8s provides a lightweight Kubernetes API client for coordination Leases. |
|
types
Package types defines common types used across the proxy package.
|
Package types defines common types used across the proxy package. |
Click to show internal directories.
Click to hide internal directories.