config

package
v1.30.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 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

This section is empty.

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 Generate added in v1.26.3

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

Generate generates a pair of client and server configuration for the given host

func Load added in v1.21.9

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

Load loads configuration from the given bytes

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