config

package
v0.0.0-...-7893bb9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileVersion = "v1.0.1"
View Source
const SetAsSystemProxyAuto = "auto"
View Source
const ShuttleVersion = "v0.6.0"

Variables

This section is empty.

Functions

func CurrentConfigFile

func CurrentConfigFile() string

func EmojiDecode

func EmojiDecode(data []byte) int

func SaveConfig

func SaveConfig(configFile string, config *Config) error

save config file

Types

type Config

type Config struct {
	Ver        string              `yaml:"ver"`
	General    *General            `yaml:"General"`
	Proxy      map[string][]string `yaml:"Proxy,[flow],2quoted"`
	ProxyGroup map[string][]string `yaml:"Proxy-Group,[flow],2quoted"`
	LocalDNSs  [][]string          `yaml:"Local-DNS,[flow],2quoted"`
	Mitm       *Mitm               `yaml:"MITM"`
	Rule       [][]string          `yaml:"Rule,[flow],2quoted"`
	HttpMap    *HttpMap            `yaml:"Http-Map"`
	RttUrl     string              `yaml:"rtt-url"`
}

func CurrentConfig

func CurrentConfig() *Config

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

load config file

func ReloadConfig

func ReloadConfig() (*Config, error)

func (*Config) GetControllerDomain

func (c *Config) GetControllerDomain() string

controller

func (*Config) GetControllerInterface

func (c *Config) GetControllerInterface() string

func (*Config) GetControllerPort

func (c *Config) GetControllerPort() string

func (*Config) GetDNSServers

func (c *Config) GetDNSServers() []string

dns func GetControllerDomain() string ==> controller func GetControllerPort() string ==> controller

func (*Config) GetGeoIPDBFile

func (c *Config) GetGeoIPDBFile() string

func (*Config) GetHTTPInterface

func (c *Config) GetHTTPInterface() string

HTTP Proxy

func (*Config) GetHTTPMap

func (c *Config) GetHTTPMap() *HttpMap

HttpMap

func (*Config) GetHTTPPort

func (c *Config) GetHTTPPort() string

func (*Config) GetLocalDNS

func (c *Config) GetLocalDNS() [][]string

func (*Config) GetLogLevel

func (c *Config) GetLogLevel() string

logger

func (*Config) GetMITM

func (c *Config) GetMITM() *Mitm

MITM

func (*Config) GetProxy

func (c *Config) GetProxy() map[string][]string

Proxy & Proxy Group

func (*Config) GetProxyGroup

func (c *Config) GetProxyGroup() map[string][]string

func (*Config) GetRttUrl

func (c *Config) GetRttUrl() string

func (*Config) GetRule

func (c *Config) GetRule() [][]string

Rule

func (*Config) GetSOCKSInterface

func (c *Config) GetSOCKSInterface() string

SOCKS Proxy

func (*Config) GetSOCKSPort

func (c *Config) GetSOCKSPort() string

func (*Config) SetControllerInterface

func (c *Config) SetControllerInterface(inter string)

func (*Config) SetControllerPort

func (c *Config) SetControllerPort(port string)

func (*Config) SetDNSServers

func (c *Config) SetDNSServers(servers []string)

func (*Config) SetHTTPInterface

func (c *Config) SetHTTPInterface(inter string)

func (*Config) SetHTTPMap

func (c *Config) SetHTTPMap(httpMap *HttpMap)

func (*Config) SetHTTPPort

func (c *Config) SetHTTPPort(port string)

func (*Config) SetLocalDNS

func (c *Config) SetLocalDNS(localDNSs [][]string)

func (*Config) SetLogLevel

func (c *Config) SetLogLevel(l string)

func (*Config) SetMITM

func (c *Config) SetMITM(mitm *Mitm)

func (*Config) SetProxy

func (c *Config) SetProxy(proxy map[string][]string)

func (*Config) SetProxyGroup

func (c *Config) SetProxyGroup(group map[string][]string)

func (*Config) SetRttUrl

func (c *Config) SetRttUrl(rttUrl string)

func (*Config) SetRule

func (c *Config) SetRule(rule [][]string)

func (*Config) SetSOCKSInterface

func (c *Config) SetSOCKSInterface(inter string)

func (*Config) SetSOCKSPort

func (c *Config) SetSOCKSPort(port string)

type General

type General struct {
	LogLevel            string   `yaml:"loglevel,2quoted"`
	DNSServer           []string `yaml:"dns-server,2quoted"`
	HttpPort            string   `yaml:"http-port,2quoted"`
	HttpInterface       string   `yaml:"http-interface,2quoted"`
	SocksPort           string   `yaml:"socks-port,2quoted"`
	SocksInterface      string   `yaml:"socks-interface,2quoted"`
	ControllerPort      string   `yaml:"controller-port,2quoted"`
	ControllerInterface string   `yaml:"controller-interface,2quoted"`
	SetAsSystemProxy    string   `yaml:"set-as-system-proxy,2quoted"`
}

type HttpMap

type HttpMap struct {
	ReqMap  []*ModifyMap `yaml:"Req-Map,2quoted" json:"req_map"`
	RespMap []*ModifyMap `yaml:"Resp-Map,2quoted" json:"resp_map"`
}

type Mitm

type Mitm struct {
	CA    string   `yaml:"ca,2quoted"`
	Key   string   `yaml:"key,2quoted"`
	Rules []string `yaml:"rules,flow,2quoted"`
}

type ModifyMap

type ModifyMap struct {
	Type   string     `yaml:"type,2quoted" json:"type"`
	UrlRex string     `yaml:"url-rex,2quoted" json:"url_rex"`
	Items  [][]string `yaml:"items,[flow],2quoted" json:"items"`
}

Jump to

Keyboard shortcuts

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