server

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalConfig = &Config{
		Addr:    "127.0.0.1:4880",
		SslAddr: "127.0.0.1:4843",
		LogFile: "logs/shuttles.log",
	}
	Passwords   = make(map[string]*Password)
	WHPasswords = make(map[string]*Password)
)

config var

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr      string `yaml:"addr"`
	SslAddr   string `yaml:"sslAddr"`
	Cert      string
	Key       string
	LogFile   string `yaml:"logFile"`
	Gateway   Gateway
	Instances []Instance
	Trojan    Trojan
	Wormhole  Wormhole
}

Config struct

func Load

func Load(path string) (config *Config, err error)

Load load config

type Filter

type Filter struct {
	Name     string
	Params   interface{}
	Open     bool
	Loggable bool
}

Filter struct

type Gateway added in v0.2.0

type Gateway struct {
	Routes []Route
}

Gateway struct

type Instance

type Instance struct {
	Group        string
	URL          string `yaml:"url"`
	Weight       int
	RegisterTime int64
	Tags         []string
}

Instance struct

type Password

type Password struct {
	Raw  string
	Hash string
}

Password struct

type Route

type Route struct {
	ID       string `yaml:"id"`
	Order    int
	Host     string
	Path     string
	Filters  []Filter
	Loggable bool
}

Route struct

func (Route) GetFilter

func (r Route) GetFilter(name string) Filter

GetFilter route get filter

type Trojan added in v0.2.0

type Trojan struct {
	Passwords []string
}

Trojan struct

type Wormhole added in v0.2.0

type Wormhole struct {
	Passwords []string
}

Wormhole struct

Jump to

Keyboard shortcuts

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