Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthProxy ¶ added in v0.6.0
type AuthProxy struct {
Username string `yaml:"username"`
Password string `yaml:"password"`
SigningKey string `yaml:"signing_key,omitempty"`
CookieTTL int `yaml:"cookie_ttl,omitempty"` // 秒,默认 86400
}
AuthProxy 鉴权代理配置
func (*AuthProxy) CookieTTLOrDefault ¶ added in v0.6.0
CookieTTLOrDefault 返回 Cookie 有效期(秒),默认 86400
type CloudflaredConfig ¶
type Config ¶
type Config struct {
Version int `yaml:"version"`
Auth AuthConfig `yaml:"auth"`
Tunnel TunnelConfig `yaml:"tunnel"`
Routes []RouteConfig `yaml:"routes"`
Relay RelayConfig `yaml:"relay,omitempty"`
Cloudflared CloudflaredConfig `yaml:"cloudflared"`
SelfUpdate SelfUpdateConfig `yaml:"self_update"`
}
func (*Config) FindRelayRule ¶ added in v0.7.0
FindRelayRule 查找中继规则
func (*Config) FindRoute ¶
func (c *Config) FindRoute(name string) *RouteConfig
func (*Config) RemoveRelayRule ¶ added in v0.7.0
RemoveRelayRule 删除中继规则
func (*Config) RemoveRoute ¶
type RelayConfig ¶ added in v0.7.0
type RelayConfig struct {
Server string `yaml:"server,omitempty"`
Token string `yaml:"token,omitempty"`
Rules []RelayRule `yaml:"rules,omitempty"`
}
RelayConfig 中继模式配置
type RelayRule ¶ added in v0.7.0
type RelayRule struct {
Name string `yaml:"name"`
Proto string `yaml:"proto"` // tcp/udp/http/https/stcp
LocalIP string `yaml:"local_ip,omitempty"` // 默认 127.0.0.1
LocalPort int `yaml:"local_port"`
RemotePort int `yaml:"remote_port,omitempty"` // HTTP 模式可选
Domain string `yaml:"domain,omitempty"` // HTTP 模式用
}
RelayRule 中继穿透规则
type RouteConfig ¶
type SelfUpdateConfig ¶
type SelfUpdateConfig struct {
AutoCheck bool `yaml:"auto_check"` // 启动时自动检查 cftunnel 更新
}
type TunnelConfig ¶
Click to show internal directories.
Click to hide internal directories.