conf

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: AGPL-3.0 Imports: 10 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 {
	Inbounds struct {
		HTTPSOCKS *HTTPSOCKS `json:"http-socks"`
		Hg        *Hg        `json:"hg"`
	} `json:"inbounds"`
	Outbounds map[string]*ProxyNode `json:"outbounds" validate:"dive"`
	Route     Route                 `json:"route"`
	Misc      Misc                  `json:"misc"`
}

func Parse

func Parse(configFilePath string) (*Config, error)

type HTTPSOCKS

type HTTPSOCKS struct {
	Host        string `json:"host" validate:"ip|hostname_rfc1123"`
	Port        uint16 `json:"port" validate:"gte=0,lte=65536"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	SystemProxy bool   `json:"system-proxy"`
}

func (*HTTPSOCKS) UnmarshalJSON added in v0.2.0

func (httpSOCKS *HTTPSOCKS) UnmarshalJSON(data []byte) error

type Hg

type Hg struct {
	Host                      string          `json:"host" validate:"ip|hostname_rfc1123"`
	Password                  Password        `json:"password" validate:"required"`
	TLSPort                   int             `json:"tls-port" validate:"gte=0,lte=65536"`
	TLSCertKeyPair            *TLSCertKeyPair `json:"tls-cert-key-pair"`
	TLSBadAuthFallbackSiteDir string          `json:"tls-bad-auth-fallback-site-dir"`
}

func (*Hg) UnmarshalJSON

func (hg *Hg) UnmarshalJSON(data []byte) error

type Misc

type Misc struct {
	HgBinaryAutoUpdate  bool `json:"hg-binary-auto-update"`
	RulesFileAutoUpdate bool `json:"rules-file-auto-update"`
	TLSKeyLog           bool `json:"tls-key-log"`
	VerboseLog          bool `json:"verbose-log"`
	Profiling           bool `json:"profiling"`
	ProfilingPort       int  `json:"profiling-port" validate:"gte=0,lte=65536"`
}

type Password added in v0.1.1

type Password struct {
	Raw    [16]byte
	String string
}

func (*Password) UnmarshalJSON added in v0.1.1

func (pw *Password) UnmarshalJSON(data []byte) error

type ProxyNode

type ProxyNode struct {
	Host        string   `json:"host" validate:"ip|hostname_rfc1123"`
	Password    Password `json:"password" validate:"required"`
	TLSPort     int      `json:"tls-port" validate:"gte=0,lte=65536"`
	TLSCertFile string   `json:"tls-cert"`
}

func (*ProxyNode) UnmarshalJSON

func (node *ProxyNode) UnmarshalJSON(data []byte) error

type Route

type Route struct {
	Rules Rules  `json:"rules" validate:"dive"`
	Final string `json:"final" validate:"required"`
}

type Rule

type Rule struct {
	Matcher *rule.Matcher `json:"match"`
	Policy  string        `json:"policy" validate:"required"`
}

type Rules added in v0.1.1

type Rules []Rule

func (Rules) CopyWithNewRulesData added in v0.1.1

func (rules Rules) CopyWithNewRulesData() (Rules, error)

func (Rules) SetupRulesData added in v0.1.1

func (rules Rules) SetupRulesData() error

type TLSCertKeyPair

type TLSCertKeyPair struct {
	CertFile string
	KeyFile  string
}

func (*TLSCertKeyPair) UnmarshalJSON

func (pair *TLSCertKeyPair) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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