cli

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0-dev"

Functions

func Execute

func Execute()

func RunProxy

func RunProxy(cmd *cobra.Command, opts RunOptions) error

RunProxy is the entrypoint for the bare `snirect` command. It bootstraps the proxy and blocks until a signal or proxy failure.

Types

type ProxyEnv

type ProxyEnv struct {
	Cfg    *config.Config
	AppDir string

	Server proxyServer
	// contains filtered or unexported fields
}

ProxyEnv holds a bootstrapped proxy ready to run, shared by the bare `snirect` entrypoint via RunProxy. The owner calls Cleanup when done.

func BootstrapProxy

func BootstrapProxy(cmd *cobra.Command) (*ProxyEnv, error)

BootstrapProxy performs the shared startup preparation: load config, build the resolver + CA + proxy server. It does NOT start serving. On error any partial state is cleaned up.

func (*ProxyEnv) Cleanup

func (env *ProxyEnv) Cleanup()

Cleanup clears the system PAC iff this process set it, then closes the resolver and certificate manager.

type RunOptions

type RunOptions struct {
	OnReady func(port int)
}

RunOptions configures RunProxy. Today the only option is OnReady; the type is kept so callers can grow it without touching RunProxy's signature.

Jump to

Keyboard shortcuts

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