tunnel

package
v0.4.0 Latest Latest
Warning

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

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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(targetPort int) *Manager

func (*Manager) GetCloudflaredStatus

func (m *Manager) GetCloudflaredStatus() TunnelStatus

func (*Manager) GetTailscaleStatus

func (m *Manager) GetTailscaleStatus() TunnelStatus

func (*Manager) RegisterRoutes

func (m *Manager) RegisterRoutes(mux interface {
	Get(pattern string, handler http.HandlerFunc)
	Post(pattern string, handler http.HandlerFunc)
})

HttpHandler exposes standard tunnel endpoints: GET /api/tunnels/cloudflared POST /api/tunnels/cloudflared GET /api/tunnels/tailscale POST /api/tunnels/tailscale/enable POST /api/tunnels/tailscale/disable

func (*Manager) StartCloudflared

func (m *Manager) StartCloudflared(ctx context.Context) (TunnelStatus, error)

func (*Manager) StartTailscale

func (m *Manager) StartTailscale(ctx context.Context) (TunnelStatus, error)

func (*Manager) StopCloudflared

func (m *Manager) StopCloudflared() (TunnelStatus, error)

func (*Manager) StopTailscale

func (m *Manager) StopTailscale() (TunnelStatus, error)

type TunnelStatus

type TunnelStatus struct {
	Name       string `json:"name"`
	Supported  bool   `json:"supported"`
	Installed  bool   `json:"installed"`
	BinaryPath string `json:"binary_path,omitempty"`
	Running    bool   `json:"running"`
	Pid        int    `json:"pid,omitempty"`
	PublicURL  string `json:"public_url,omitempty"`
	ApiURL     string `json:"api_url,omitempty"`
	TargetURL  string `json:"target_url,omitempty"`
	Phase      string `json:"phase"` // "stopped", "starting", "running", "error"
	LastError  string `json:"last_error,omitempty"`
}

Jump to

Keyboard shortcuts

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