Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v2.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"`                 //nolint: lll
	PublicIPv4 net.IP `kong:"help='Public IPv4 address for proxy. By default it is resolved via remote website',name='ipv4',short='i'"`   //nolint: lll
	PublicIPv6 net.IP `kong:"help='Public IPv6 address for proxy. By default it is resolved via remote website',name='ipv6',short='I'"`   //nolint: lll
	Port       uint   `kong:"help='Port number. Default port is taken from configuration file, bind-to parameter',type:'uint',short='p'"` //nolint: lll
	Hex        bool   `kong:"help='Print secret in hex encoding.',short='x'"`
}

func (*Access) Run

func (a *Access) Run(cli *CLI, version string) error

type CLI

type CLI struct {
	GenerateSecret GenerateSecret   `kong:"cmd,help='Generate new proxy secret'"`
	Doctor         Doctor           `kong:"cmd,help='Check that proxy can run correctly'"`
	Access         Access           `kong:"cmd,help='Print access information.'"`
	Run            Run              `kong:"cmd,help='Run proxy.'"`
	SimpleRun      SimpleRun        `kong:"cmd,help='Run proxy without config file.'"`
	Version        kong.VersionFlag `kong:"help='Print version.',short='v'"`
}

type Doctor added in v2.2.4

type Doctor struct {
	ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
	// contains filtered or unexported fields
}

func (*Doctor) Run added in v2.2.4

func (d *Doctor) Run(cli *CLI, version string) error

type GenerateSecret

type GenerateSecret struct {
	HostName string `kong:"arg,required,help='Hostname to use for domain fronting.',name='hostname'"`
	Hex      bool   `kong:"help='Print secret in hex encoding.',short='x'"`
}

func (*GenerateSecret) Run

func (g *GenerateSecret) Run(cli *CLI, _ string) error

type Run added in v2.1.0

type Run struct {
	ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
}

func (*Run) Run added in v2.1.0

func (r *Run) Run(cli *CLI, version string) error

type SimpleRun added in v2.1.0

type SimpleRun struct {
	BindTo string `kong:"arg,required,name='bind-to',help='A host:port to bind proxy to.'"`
	Secret string `kong:"arg,required,name='secret',help='Proxy secret.'"`

	Debug       bool   `kong:"name='debug',short='d',help='Run in debug mode.'"`                                                 //nolint: lll
	Concurrency uint64 `kong:"name='concurrency',short='c',default='8192',help='Max number of concurrent connection to proxy.'"` //nolint: lll
	TCPBuffer   string `kong:"name='tcp-buffer',short='b',default='4KB',help='Deprecated and ignored'"`                          //nolint: lll
	PreferIP    string ``                                                                                                        //nolint: lll
	/* 126-byte string literal not displayed */
	DomainFrontingPort  uint64        `kong:"name='domain-fronting-port',short='p',default='443',help='A port to access for domain fronting.'"`                     //nolint: lll
	DomainFrontingIP    string        `kong:"name='domain-fronting-ip',help='An IP address to use for domain fronting instead of resolving the hostname via DNS.'"` //nolint: lll
	DOHIP               net.IP        `kong:"name='doh-ip',short='n',default='1.1.1.1',help='IP address of DNS-over-HTTP to use.'"`                                 //nolint: lll
	Timeout             time.Duration `kong:"name='timeout',short='t',default='10s',help='Network timeout to use'"`                                                 //nolint: lll
	Socks5Proxies       []string      `kong:"name='socks5-proxy',short='s',help='Socks5 proxies to use for network access.'"`                                       //nolint: lll
	AntiReplayCacheSize string        `kong:"name='antireplay-cache-size',short='a',default='1MB',help='A size of anti-replay cache to use.'"`                      //nolint: lll
}

func (*SimpleRun) Run added in v2.1.0

func (s *SimpleRun) Run(cli *CLI, version string) error

Jump to

Keyboard shortcuts

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