webrelay

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 20 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

Overview

Package webrelay serves the embedded croc web client and exposes its deliberately small WebSocket-to-TCP bridge. The bridge never participates in the croc protocol; it only forwards an opaque byte stream to one fixed relay host and an allowlisted relay port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(config Config) (http.Handler, error)

Handler returns the unified croc web handler. It serves the embedded client, /config.js, /healthz, and /ws?relay=<index>&port=<allowlisted relay port>.

func Run

func Run(ctx context.Context, config Config) error

Run starts the unified web client and relay bridge and blocks until the context is cancelled or the server exits.

Types

type Config

type Config struct {
	ListenAddress string
	RelayHosts    []string
	// RelayHost is retained as a single-host configuration shorthand.
	RelayHost      string
	AllowedPorts   []string
	OriginPatterns []string
	DialTimeout    time.Duration
	PublicAddress  string
	RelayPassword  string
	StaticFiles    fs.FS
	StoreService   *store.Service
	UmamiURL       string
	UmamiWebsiteID string
	GoogleAdSense  string
	GoogleAdsTXT   string
	// contains filtered or unexported fields
}

Config configures the unified croc web server.

Jump to

Keyboard shortcuts

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