config

package
v1.26.6 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate added in v1.26.3

func Generate(ip, srvConfOutput, cliConfOutput string) error

Generate generates the corrensponding client and server config file

Types

type Config

type Config struct {
	SOCKSListen   string         `json:"socksListen,omitempty"`
	HTTPListen    string         `json:"httpListen,omitempty"`
	TunnelListens []TunnelListen `json:"tunnelListens,omitempty"`
	TunnelClients []TunnelClient `json:"tunnelClients,omitempty"`
	Rules         []string       `json:"rules,omitempty"`
	// developer only: enable debug logging, start HTTP server for profiling
	Debug bool `json:"debug,omitempty"`
}

func Load added in v1.21.9

func Load(bs []byte) (Config, error)

Load loads configuration from the given bytes

func Pair added in v1.26.3

func Pair(host string) (srv, cli Config, err error)

Pair make a pair of client and server config

type Lines added in v1.26.6

type Lines []string

func (Lines) Merge added in v1.26.6

func (l Lines) Merge() string

Merge merges list of strings into multiple lines

type TunnelClient added in v1.26.0

type TunnelClient struct {
	Type    TunnelType `json:"type"`
	Policy  string     `json:"policy"`
	Address string     `json:"address"` // target server address

	CertFile string `json:"certFile,omitempty"`
	CertPEM  Lines  `json:"certPEM,omitempty"`
	KeyFile  string `json:"keyFile,omitempty"`
	KeyPEM   Lines  `json:"keyPEM,omitempty"`
	CAFile   string `json:"caFile,omitempty"`
	CAPEM    Lines  `json:"caPEM,omitempty"`

	PoolSize int `json:"poolSize,omitempty"`
}

type TunnelListen added in v1.26.0

type TunnelListen struct {
	Type     TunnelType `json:"type"`
	Listen   string     `json:"listen"`
	CertFile string     `json:"certFile,omitempty"`
	CertPEM  Lines      `json:"certPEM,omitempty"`
	KeyFile  string     `json:"keyFile,omitempty"`
	KeyPEM   Lines      `json:"keyPEM,omitempty"`
	CAFile   string     `json:"caFile,omitempty"`
	CAPEM    Lines      `json:"caPEM,omitempty"`
}

type TunnelType added in v1.26.0

type TunnelType string
const (
	TunGRPC TunnelType = "grpc"
	TunQUIC TunnelType = "quic"
)

Jump to

Keyboard shortcuts

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