outbound

package
v0.0.0-...-133c9a2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDialerCreator

func RegisterDialerCreator(name string, c Creator)

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

type ContextDialer

type ContextDialer interface {
	DialContext(ctx context.Context, m *C.Metadata) (c net.Conn, err error)
}

type Creator

type Creator func(link string) (Dialer, error)

func GetDialerCreator

func GetDialerCreator(name string) (Creator, error)

type Dialer

type Dialer interface {
	ContextDialer
	DialUDP(m *C.Metadata) (net.PacketConn, error)
}

type HTTP2Options

type HTTP2Options struct {
	Host []string `proxy:"host,omitempty"`
	Path string   `proxy:"path,omitempty"`
}

type HTTPOptions

type HTTPOptions struct {
	Method  string              `proxy:"method,omitempty"`
	Path    []string            `proxy:"path,omitempty"`
	Headers map[string][]string `proxy:"headers,omitempty"`
}

type ShadowSocks

type ShadowSocks struct {
	*Base
	// contains filtered or unexported fields
}

func NewShadowSocks

func NewShadowSocks(option *ShadowSocksOption) (*ShadowSocks, error)

func (*ShadowSocks) DialContext

func (ss *ShadowSocks) DialContext(ctx context.Context, metadata *C.Metadata) (net.Conn, error)

func (*ShadowSocks) DialUDP

func (ss *ShadowSocks) DialUDP(metadata *C.Metadata) (net.PacketConn, error)

func (*ShadowSocks) MarshalJSON

func (ss *ShadowSocks) MarshalJSON() ([]byte, error)

func (*ShadowSocks) StreamConn

func (ss *ShadowSocks) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)

type ShadowSocksOption

type ShadowSocksOption struct {
	Name       string                 `proxy:"name,omitempty"`
	Server     string                 `proxy:"server"`
	Port       int                    `proxy:"port"`
	Password   string                 `proxy:"password"`
	Cipher     string                 `proxy:"cipher"`
	UDP        bool                   `proxy:"udp,omitempty"`
	Plugin     string                 `proxy:"plugin,omitempty"`
	PluginOpts map[string]interface{} `proxy:"plugin-opts,omitempty"`
	Remarks    string                 `proxy:"remarks,omitempty"`
}

type ShadowSocksR

type ShadowSocksR struct {
	*Base
	// contains filtered or unexported fields
}

func NewShadowSocksR

func NewShadowSocksR(option *ShadowSocksROption) (*ShadowSocksR, error)

func (*ShadowSocksR) DialContext

func (ssr *ShadowSocksR) DialContext(ctx context.Context, metadata *C.Metadata) (net.Conn, error)

func (*ShadowSocksR) DialUDP

func (ssr *ShadowSocksR) DialUDP(metadata *C.Metadata) (net.PacketConn, error)

func (*ShadowSocksR) MarshalJSON

func (ssr *ShadowSocksR) MarshalJSON() ([]byte, error)

func (*ShadowSocksR) StreamConn

func (ssr *ShadowSocksR) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)

type ShadowSocksROption

type ShadowSocksROption struct {
	Name          string `proxy:"name,omitempty"`
	Server        string `proxy:"server"`
	Port          int    `proxy:"port"`
	Password      string `proxy:"password"`
	Cipher        string `proxy:"cipher"`
	Obfs          string `proxy:"obfs"`
	ObfsParam     string `proxy:"obfs-param,omitempty"`
	Protocol      string `proxy:"protocol"`
	ProtocolParam string `proxy:"protocol-param,omitempty"`
	UDP           bool   `proxy:"udp,omitempty"`
	Remarks       string `proxy:"remarks,omitempty"`
}

type Trojan

type Trojan struct {
	*Base
	// contains filtered or unexported fields
}

func NewTrojan

func NewTrojan(option *TrojanOption) (*Trojan, error)

func (*Trojan) DialContext

func (t *Trojan) DialContext(ctx context.Context, metadata *C.Metadata) (net.Conn, error)

func (*Trojan) DialUDP

func (t *Trojan) DialUDP(metadata *C.Metadata) (net.PacketConn, error)

func (*Trojan) MarshalJSON

func (t *Trojan) MarshalJSON() ([]byte, error)

func (*Trojan) StreamConn

func (t *Trojan) StreamConn(c net.Conn, metadata *C.Metadata) (net.Conn, error)

type TrojanOption

type TrojanOption struct {
	Name           string   `proxy:"name,omitempty"`
	Server         string   `proxy:"server"`
	Port           int      `proxy:"port"`
	Password       string   `proxy:"password"`
	ALPN           []string `proxy:"alpn,omitempty"`
	SNI            string   `proxy:"sni,omitempty"`
	SkipCertVerify bool     `proxy:"skip-cert-verify,omitempty"`
	UDP            bool     `proxy:"udp,omitempty"`
	Remarks        string   `proxy:"remarks,omitempty"`
}

type Vmess

type Vmess struct {
	*Base
	// contains filtered or unexported fields
}

func NewVmess

func NewVmess(option *VmessOption) (*Vmess, error)

func (*Vmess) DialContext

func (v *Vmess) DialContext(ctx context.Context, metadata *C.Metadata) (net.Conn, error)

func (*Vmess) DialUDP

func (v *Vmess) DialUDP(metadata *C.Metadata) (net.PacketConn, error)

func (*Vmess) MarshalJSON

func (v *Vmess) MarshalJSON() ([]byte, error)

type VmessOption

type VmessOption struct {
	Name           string            `proxy:"name,omitempty"`
	Server         string            `proxy:"server"`
	Port           uint16            `proxy:"port"`
	UUID           string            `proxy:"uuid"`
	AlterID        int               `proxy:"alterId,omitempty"`
	Cipher         string            `proxy:"cipher"`
	TLS            bool              `proxy:"tls,omitempty"`
	UDP            bool              `proxy:"udp,omitempty"`
	Network        string            `proxy:"network,omitempty"`
	HTTPOpts       HTTPOptions       `proxy:"http-opts,omitempty"`
	HTTP2Opts      HTTP2Options      `proxy:"h2-opts,omitempty"`
	WSPath         string            `proxy:"ws-path,omitempty"`
	WSHeaders      map[string]string `proxy:"ws-headers,omitempty"`
	SkipCertVerify bool              `proxy:"skip-cert-verify,omitempty"`
	ServerName     string            `proxy:"servername,omitempty"`
	Type           string            `proxy:"type,omitempty"`
	WSOpts         WSOptions         `proxy:"ws-opts,omitempty"`
}

type WSOptions

type WSOptions struct {
	Path                string            `proxy:"path,omitempty"`
	Headers             map[string]string `proxy:"headers,omitempty"`
	MaxEarlyData        int               `proxy:"max-early-data,omitempty"`
	EarlyDataHeaderName string            `proxy:"early-data-header-name,omitempty"`
}

Jump to

Keyboard shortcuts

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