config

package
v1.30.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TunGRPC  = "grpc"
	TunQUIC  = "quic"
	TunHTTP2 = "http2"
)

tunnel type

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"`
	// 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 TunnelClient added in v1.26.0

type TunnelClient struct {
	Name string `json:"name"`
	// deprecated, use Name instead
	Policy   string   `json:"policy,omitempty"`
	Type     string   `json:"type"`
	Address  string   `json:"address"` // target server address
	CertFile string   `json:"certFile,omitempty"`
	CertPEM  []string `json:"certPEM,omitempty"`
	KeyFile  string   `json:"keyFile,omitempty"`
	KeyPEM   []string `json:"keyPEM,omitempty"`
	CAFile   string   `json:"caFile,omitempty"`
	CAPEM    []string `json:"caPEM,omitempty"`

	MaxStreamsPerConn int `json:"maxStreamsPerConn,omitempty"`
}

func (*TunnelClient) GetCAPEM added in v1.26.8

func (tc *TunnelClient) GetCAPEM() ([]byte, error)

func (*TunnelClient) GetCertPEM added in v1.26.8

func (tc *TunnelClient) GetCertPEM() ([]byte, error)

func (*TunnelClient) GetKeyPEM added in v1.26.8

func (tc *TunnelClient) GetKeyPEM() ([]byte, error)

type TunnelListen added in v1.26.0

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

func (*TunnelListen) GetCAPEM added in v1.26.8

func (tl *TunnelListen) GetCAPEM() ([]byte, error)

func (*TunnelListen) GetCertPEM added in v1.26.8

func (tl *TunnelListen) GetCertPEM() ([]byte, error)

func (*TunnelListen) GetKeyPEM added in v1.26.8

func (tl *TunnelListen) GetKeyPEM() ([]byte, error)

Jump to

Keyboard shortcuts

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