config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr      string
	SSHServer       string
	SSHUser         string
	SSHPassword     string
	SSHKeyFile      string
	HTTPUpstream    string        // 强制 HTTP 上游 (原 SSHTargetDial)
	SSHPort         string        // 添加SSH端口配置
	SocksAddr       string        // SOCKS5 监听地址
	TunMode         bool          // 是否启用 TUN 模式
	TunCIDR         string        // TUN 设备 CIDR (e.g. 10.0.0.1/24)
	TunRoute        []string      // 需要路由到 TUN 的网段
	TunGlobal       bool          // 是否开启全局模式
	SubnetAliases   []SubnetAlias // 网段/IP映射规则 (NAT)
	JumpHosts       []string      // 跳板机列表
	Timeout         time.Duration
	Verbose         bool
	LogFile         string
	InteractiveAuth bool
	SystemProxy     bool // 是否启用系统代理
	RuleFile        string
}

Config 存储应用配置

func NewConfig

func NewConfig() *Config

NewConfig 创建默认配置

func (*Config) GetJumpHostInfo added in v0.3.0

func (c *Config) GetJumpHostInfo(jumpHost string) (user, host, port string, err error)

GetJumpHostInfo 获取跳板机信息

func (*Config) Validate

func (c *Config) Validate() error

Validate 验证配置

type SubnetAlias added in v0.8.0

type SubnetAlias struct {
	Src *net.IPNet
	Dst *net.IPNet
}

SubnetAlias 定义网段映射规则

Jump to

Keyboard shortcuts

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