web

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PathPrefix = "/__netbird__"

PathPrefix is the unique URL prefix for serving the proxy's own web assets. Using a distinctive prefix prevents collisions with backend application routes.

Variables

This section is empty.

Functions

func AssetHandler

func AssetHandler(next http.Handler) http.Handler

AssetHandler returns middleware that intercepts requests for the proxy's own web assets (under PathPrefix) and serves them from the embedded filesystem, preventing them from being forwarded to backend services.

func ServeAccessDeniedPage

func ServeAccessDeniedPage(w http.ResponseWriter, r *http.Request, code int, title, message, requestID string)

ServeAccessDeniedPage renders a simple access denied page without the connection status graph.

func ServeErrorPage

func ServeErrorPage(w http.ResponseWriter, r *http.Request, code int, title, message, requestID string, status ErrorStatus)

ServeErrorPage renders a user-friendly error page with the given details.

func ServeHTTP

func ServeHTTP(w http.ResponseWriter, r *http.Request, data any, statusCode ...int)

ServeHTTP serves the web UI. For static assets it serves them directly, for other paths it renders the page with the provided data. Optional statusCode can be passed to set a custom HTTP status code (default 200).

Types

type ErrorStatus

type ErrorStatus struct {
	Proxy       bool
	Destination bool
}

ErrorStatus represents the connection status for each component in the error page.

Jump to

Keyboard shortcuts

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