networkendpoint

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	WebSocketPath   = "/v2/ws"
	ShareRouteQuery = "share_id"
)

Variables

View Source
var ErrInvalid = errors.New("invalid network endpoint")
View Source
var ErrWhitespace = fmt.Errorf("%w: relay whitespace", ErrInvalid)

ErrWhitespace identifies rejected spacing at the validation source, so callers do not mistake otherwise valid path contents for the failure cause.

Functions

func BaseFromWebSocketURL

func BaseFromWebSocketURL(endpoint url.URL) (url.URL, bool)

BaseFromWebSocketURL converts a full endpoint back to a candidate base. The escaped mount and routing query participate in dialing and must round-trip.

func NormalizeSTUN

func NormalizeSTUN(raw string) (string, error)

NormalizeSTUN accepts the UDP endpoint contract shared by native and browser ICE. It only validates deployment data; it never resolves or probes the address.

Types

type NumericHostError

type NumericHostError struct {
	Host string
}

NumericHostError preserves the host that WHATWG attempts to parse as IPv4 rather than DNS. Callers can explain the rejection without parsing an error message or exposing the URL's credentials.

func (*NumericHostError) Error

func (err *NumericHostError) Error() string

func (*NumericHostError) Unwrap

func (err *NumericHostError) Unwrap() error

type Relay

type Relay struct {
	DialURL     string
	IdentityURL string
	Identity    [sha256.Size]byte
}

func NormalizeRelay

func NormalizeRelay(raw string) (Relay, error)

NormalizeRelay is the single production implementation of the endpoint bytes signed by registration and stop. Query credentials remain on DialURL but are deliberately excluded from the long-lived relay identity.

type RelayBaseHint

type RelayBaseHint struct {
	// contains filtered or unexported fields
}

RelayBaseHint is a display address. Routing queries never enter diagnostics.

func WebSocketBaseHint

func WebSocketBaseHint(address string) (RelayBaseHint, bool)

WebSocketBaseHint can explain a failed route or a discovery mismatch. A suffix alone says nothing about whether the original candidate is a working mount.

func (RelayBaseHint) URL

func (hint RelayBaseHint) URL() string

Jump to

Keyboard shortcuts

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