proxy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DaemonRunning

func DaemonRunning(reg *registry.Store) (bool, error)

DaemonRunning reports whether the machine-wide proxy daemon is alive.

func EnsureDaemon

func EnsureDaemon(reg *registry.Store) (bool, error)

EnsureDaemon starts the machine-wide proxy daemon as a detached process if one is not already running, and returns true if it started a new one. The daemon is `isola proxy start`; its output goes to proxy.log under the registry's global dir, and it survives this process exiting.

func ParseHost

func ParseHost(host string) (slug, project string)

ParseHost splits a Host header into slug and project for the qualified scheme "<slug>.<project>.localhost[:port]". A bare "<slug>.localhost" yields an empty project; "localhost" (or a non-.localhost host) yields both empty. Slugs and project names are single DNS labels, so the label before ".localhost" is the project and the one before that is the slug.

func StopDaemon

func StopDaemon(reg *registry.Store) (bool, error)

StopDaemon signals the running daemon to shut down and clears its recorded state. It returns true if a running daemon was found.

Types

type Daemon

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

Daemon is the single machine-wide reverse proxy. It binds the union of every registered project's proxy ports and routes <slug>.<project>.localhost to that project's backends, resolving live from each project's own state.

func NewDaemon

func NewDaemon(reg *registry.Store) *Daemon

NewDaemon creates a Daemon backed by the given registry. Certificates for HTTPS ports live under the registry's global dir, so one CA covers every project and `isola trust` runs once.

func (*Daemon) Serve

func (d *Daemon) Serve(ctx context.Context) error

Serve binds current ports and keeps binding newly registered ones until ctx is canceled, then shuts every listener down.

type Resolver

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

Resolver maps slug + proxy_port to real backend port.

func NewResolver

func NewResolver(cfg *config.Config, store *state.FileStore) *Resolver

NewResolver creates a new Resolver.

func (*Resolver) Resolve

func (r *Resolver) Resolve(slug string, proxyPort int) (int, error)

Resolve returns the real backend port for a slug and proxy port.

Jump to

Keyboard shortcuts

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