config

package
v0.0.0-...-1c66c14 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Certificate    string   `json:"cert"`
	PrivateKey     string   `json:"key"`
	AutorizedCerts []string `json:"authcerts"`
}

type Main

type Main struct {
	Name          string            `json:"name"`
	Domain        string            `json:"vdomain"`
	ServerName    string            `json:"sni"`
	Listen        string            `json:"listen"`
	HTTPListen    string            `json:"httplisten"`
	AdvertiseAddr string            `json:"addr"`
	Servers       []Server          `json:"servers"`
	Hosts         map[string]string `json:"hosts"`

	Routes    Routes    `json:"routes"`
	Auth      Auth      `json:"auth"`
	Transport Transport `json:"transport"`

	Socks5 []Socks5 `json:"socks5"`

	LogLevel int    `json:"loglevel"`
	Log      string `json:"log"`
}

func New

func New() *Main

func ReadFile

func ReadFile(filename string) (*Main, error)

type Routes

type Routes struct {
	CacheTimeout int      `json:"cachetimeout"`
	Rules        []string `json:"rules"`
	Default      string   `json:"default"`
}

type Server

type Server struct {
	ServerName string `json:"sni"`
	Address    string `json:"addr"`
}

type Socks5

type Socks5 struct {
	Listen  string `json:"listen"`
	Forward string `json:"forward"`
}

type Transport

type Transport struct {
	NoDelay           bool   `json:"nodelay"`
	Linger            int    `json:"linger"`
	KeepAliveInterval int    `json:"keepalive"`
	Timeout           int    `json:"timeout"`
	WriteTimeout      int    `json:"writetimeout"`
	IdleTimeout       int    `json:"idletimeout"`
	StreamWindow      uint32 `json:"window"`
}

Jump to

Keyboard shortcuts

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