configs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefServerPort = 8909
View Source
var DefWebPort = 8000

Functions

func IsExist

func IsExist(cfgPath string) bool

func WriterConfig

func WriterConfig(cfgPath string, cfg *ClientConfig) error

WriterConfig

@Description: Get Config.
@return ServerConfig

Types

type ClientConfig

type ClientConfig struct {
	ServerPort  int                    `json:"serverPort"`
	ServerHost  string                 `json:"serverHost"`
	ManagerPort int                    `json:"managerPort"`
	Token       string                 `json:"token"`
	PingTime    time.Duration          `json:"pingTime"`
	Tunnels     []*ClientTunnelConfig  `json:"tunnels"`
	Visitors    []*ClientVisitorConfig `json:"visitors"`
	Logger      *LoggerConfig          `json:"logger,omitempty"`
}

ClientConfig @Description: Description.

type ClientTunnelConfig

type ClientTunnelConfig struct {
	TunnelType  lang.TunnelType `json:"type"`
	Destination string          `json:"destination"`
	ProxyId     string          `json:"proxyId"`
	HttpId      string          `json:"httpId,omitempty"`
	//default 1500
	UdpSize    int `json:"udpSize,omitempty"`
	RemotePort int `json:"-"`
	MaxConn    int `json:"maxConn,omitempty"`
}

type ClientVisitorConfig added in v0.4.0

type ClientVisitorConfig struct {
	Id          string `json:"id"`
	Token       string `json:"token"`
	Destination string `json:"destination"`
	LocalPort   int    `json:"localPort"`
}

type HttpRunnelProxy

type HttpRunnelProxy struct {
	Id     string   `json:"id"`
	Domain string   `json:"domain"`
	Paths  []string `json:"paths"`
}

type LoggerConfig

type LoggerConfig struct {
	LoggLevel string `json:"logLevel"`
	LogPath   string `json:"logPath"`
	Outs      string `json:"outs"`
}

LoggerConfig @Description:

type ServerConfig

type ServerConfig struct {
	ServerPort int                   `json:"serverPort"`
	TunnelPort int                   `json:"tunnelPort"`
	Token      string                `json:"token"`
	EnableWeb  bool                  `json:"enableWeb"`
	WebPort    int                   `json:"webPort"`
	Tunnel     []*ServerTunnelConfig `json:"tunnel"`
	Logger     LoggerConfig          `json:"logger"`
}

ServerConfig @Description: 配置文件存储.

func GetServerConfig

func GetServerConfig(cfgPath string) (ServerConfig, error)

GetServerConfig

@Description: Get Config.
@return ServerConfig

type ServerTunnelConfig

type ServerTunnelConfig struct {
	Id          string            `json:"id"`
	Port        int               `json:"port"`
	Type        lang.TunnelType   `json:"type"`
	KeyFile     string            `json:"keyfile"`
	CertFile    string            `json:"certFile"`
	Http        []HttpRunnelProxy `json:"http"`
	Destination string            `json:"destination"`
	KeyContent  string            `json:"-"`
	CertContent string            `json:"-"`
	IsFileCert  bool              `json:"-"`
	IpStrategy  string            `json:"-"`
}

Jump to

Keyboard shortcuts

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