compose

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KnotForward = "forward"
	KnotSocks5  = "socks5"
	KnotSSH     = "ssh"
)
View Source
const (
	NetworkBasic  = "basic"
	NetworkMaster = "master"
	NetworkSSH    = "ssh"
)
View Source
const (
	ProxyForward = "forward"
	ProxyHTTP    = "http"
	ProxySocks5  = "socks5"
)
View Source
const (
	CryptoTLS = "tls"
)

Variables

View Source
var AvailableKnots = [3]string{KnotForward, KnotSocks5, KnotSSH}

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Username   *string `yaml:"username,omitempty" json:"username,omitempty"`
	Password   *string `yaml:"password,omitempty" json:"password,omitempty"`
	PrivateKey *string `yaml:"privateKey,omitempty" json:"privateKey,omitempty"`
	ServerKey  *string `yaml:"serverKey,omitempty" json:"serverKey,omitempty"`
}

func (*Auth) SSHClientConfig

func (a *Auth) SSHClientConfig() (config *ssh.ClientConfig, err error)

func (*Auth) Socks5

func (a *Auth) Socks5() (auth *proxy.Auth, err error)

type AuthMethod

type AuthMethod struct {
	Raw map[string]string
}

func (*AuthMethod) Socks5

func (am *AuthMethod) Socks5() (auth socks5.Authenticator, err error)

type AuthMethods

type AuthMethods []AuthMethod

func (AuthMethods) Socks5

func (am AuthMethods) Socks5() ([]socks5.Authenticator, error)

type Circuit

type Circuit struct {
	Network  string  `yaml:"network" json:"network"`
	Address  string  `yaml:"address" json:"address"`
	Listener Network `yaml:"listener" json:"listener"`
	Knots    []Knot  `yaml:"knots" json:"knots"`
	// contains filtered or unexported fields
}

func (*Circuit) Serve

func (c *Circuit) Serve() (err error)

type Compose

type Compose struct {
	Circuits map[string]*Circuit `yaml:"circuits,omitempty" json:"circuits,omitempty"`
	Proxies  map[string]*Proxy   `yaml:"proxies,omitempty" json:"proxies,omitempty"`
	Slaves   map[string]*Slave   `yaml:"slaves,omitempty" json:"slaves,omitempty"`
}

func (*Compose) Start

func (c *Compose) Start() error

type Crypto

type Crypto struct {
	Mode               string  `yaml:"mode,omitempty" json:"mode,omitempty"`
	SelfSigned         bool    `yaml:"selfSigned" json:"selfSigned"`
	InsecureSkipVerify *bool   `yaml:"insecureSkipVerify,omitempty" json:"insecureSkipVerify,omitempty"`
	Cert               *string `yaml:"cert,omitempty" json:"cert,omitempty"`
	Key                *string `yaml:"key,omitempty" json:"key,omitempty"`
}

func (*Crypto) WrapConn

func (c *Crypto) WrapConn(conn net.Conn) (net.Conn, error)

func (*Crypto) WrapListener

func (c *Crypto) WrapListener(l net.Listener) (net.Listener, error)

type Filter

type Filter struct {
	Whitelist []Match `yaml:"whitelist,omitempty" json:"whitelist,omitempty"`
	Blacklist []Match `yaml:"blacklist,omitempty" json:"blacklist,omitempty"`
}

func (*Filter) DialFunc

func (f *Filter) DialFunc(dialFunc network.DialFunc) (*filter.DialFunc, error)

func (*Filter) Listener

func (f *Filter) Listener(l net.Listener) (net.Listener, error)

type Knot

type Knot struct {
	Type    string `yaml:"type,omitempty" json:"type,omitempty"`
	Network string `yaml:"network,omitempty" json:"network,omitempty"`
	Address string `yaml:"address,omitempty" json:"address,omitempty"`
	Auth    *Auth  `yaml:"auth,omitempty" json:"auth,omitempty"`
}

func (*Knot) Compile

func (k *Knot) Compile() (circuit.Knot, error)

type Match

type Match struct {
	Host  *string    `yaml:"host,omitempty" json:"host,omitempty"`
	Port  *int       `yaml:"port,omitempty" json:"port,omitempty"`
	Range *PortRange `yaml:"portRange,omitempty" json:"portRange,omitempty"`
}

func (*Match) Compile

func (m *Match) Compile() (filter.Match, error)

type Network

type Network struct {
	Type           string   `yaml:"type" json:"type"`
	Network        *string  `yaml:"network,omitempty" json:"network,omitempty"`
	Address        *string  `yaml:"address,omitempty" json:"address,omitempty"`
	Data           *Network `yaml:"data,omitempty" json:"data,omitempty"`
	Control        *Network `yaml:"control,omitempty" json:"control,omitempty"`
	Auth           *Auth    `yaml:"auth,omitempty" json:"auth,omitempty"`
	Crypto         *Crypto  `yaml:"crypto,omitempty" json:"crypto,omitempty"`
	SlaveListener  *bool    `yaml:"slaveListener,omitempty" json:"slaveListener,omitempty"`
	ListenerFilter *Filter  `yaml:"listenerFilter,omitempty" json:"listenerFilter,omitempty"`
	DialFilter     *Filter  `yaml:"dialFilter,omitempty" json:"dialFilter,omitempty"`
	// contains filtered or unexported fields
}

func (*Network) DialFunc

func (n *Network) DialFunc() (dialFunc network.DialFunc, err error)

func (*Network) Listen

func (n *Network) Listen() (ll net.Listener, err error)

type PortRange

type PortRange struct {
	From *int `yaml:"from,omitempty" json:"from,omitempty"`
	To   *int `yaml:"to,omitempty" json:"to,omitempty"`
}

type Proxy

type Proxy struct {
	Type        string      `yaml:"type" json:"type"`
	Listener    Network     `yaml:"listener" json:"listener"`
	Dialer      *Network    `yaml:"dialer,omitempty" json:"dialer,omitempty"`
	Network     *string     `yaml:"network,omitempty" json:"network,omitempty"`
	Address     *string     `yaml:"address,omitempty" json:"address,omitempty"`
	AuthMethods AuthMethods `yaml:"authMethods,omitempty" json:"authMethods,omitempty"`
	// contains filtered or unexported fields
}

func (*Proxy) Serve

func (p *Proxy) Serve() (err error)

type Slave

type Slave struct {
	MasterNetwork string   `yaml:"masterNetwork" json:"masterNetwork"`
	MasterAddress string   `yaml:"masterAddress" json:"masterAddress"`
	MasterDialer  Network  `yaml:"masterDialer" json:"masterDialer"`
	Dialer        Network  `yaml:"dialer" json:"dialer"`
	Listener      *Network `yaml:"listener,omitempty" json:"listener,omitempty"`
	// contains filtered or unexported fields
}

func (*Slave) Serve

func (s *Slave) Serve() (err error)

Jump to

Keyboard shortcuts

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