tunnel

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tunnel gives cuxdeck its accountless public address. It downloads cloudflared once (kept under the cuxdeck home), spawns a Quick Tunnel pointed at the local server, extracts the random trycloudflare.com URL, and supervises the process: if the tunnel dies, it is rebuilt with backoff and the new URL is reported so the UI (and, later, Web Push) can tell paired devices where the panel moved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	LocalPort int
	Dir       string           // where cloudflared lives (e.g. ~/.cuxdeck/bin)
	OnURL     func(url string) // called on every (re)establishment
	Logf      func(format string, a ...any)
}

Manager runs one supervised quick tunnel.

func (*Manager) EnsureBinary

func (m *Manager) EnsureBinary(ctx context.Context) error

EnsureBinary downloads cloudflared on first use. Downloads ride TLS from GitHub's official release; the binary is stored 0700 inside cuxdeck's own directory and never touches PATH.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context)

Run supervises the tunnel until ctx is cancelled. Each successful (re)establishment invokes OnURL with the fresh address.

Jump to

Keyboard shortcuts

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