outbound

package
v0.0.0-...-890cd7e Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithTag

func ContextWithTag(ctx context.Context, outboundTag string) context.Context

func CopyEarlyConn

func CopyEarlyConn(ctx context.Context, conn net.Conn, serverConn net.Conn) error

func New

func New(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.Outbound) (adapter.Outbound, error)

func NewConnection

func NewConnection(ctx context.Context, this N.Dialer, conn net.Conn, metadata adapter.InboundContext) error

func NewError

func NewError(logger log.ContextLogger, ctx context.Context, err error)

func NewHysteria

func NewHysteria(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.HysteriaOutboundOptions) (adapter.Outbound, error)

func NewPacketConnection

func NewPacketConnection(ctx context.Context, this N.Dialer, conn N.PacketConn, metadata adapter.InboundContext) error

func NewWireGuard

func NewWireGuard(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.WireGuardOutboundOptions) (adapter.Outbound, error)

func TagFromContext

func TagFromContext(ctx context.Context) (string, bool)

Types

type Block

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

func NewBlock

func NewBlock(logger log.ContextLogger, tag string) *Block

func (*Block) Dependencies

func (a *Block) Dependencies() []string

func (*Block) DialContext

func (h *Block) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Block) ListenPacket

func (h *Block) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Block) Network

func (a *Block) Network() []string

func (*Block) NewConnection

func (h *Block) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Block) NewError

func (a *Block) NewError(ctx context.Context, err error)

func (*Block) NewPacketConnection

func (h *Block) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Block) Tag

func (a *Block) Tag() string

func (*Block) Type

func (a *Block) Type() string

type DNS

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

func NewDNS

func NewDNS(router adapter.Router, tag string) *DNS

func (*DNS) Dependencies

func (a *DNS) Dependencies() []string

func (*DNS) DialContext

func (d *DNS) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*DNS) ListenPacket

func (d *DNS) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*DNS) Network

func (a *DNS) Network() []string

func (*DNS) NewConnection

func (d *DNS) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*DNS) NewError

func (a *DNS) NewError(ctx context.Context, err error)

func (*DNS) NewPacketConnection

func (d *DNS) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*DNS) Tag

func (a *DNS) Tag() string

func (*DNS) Type

func (a *DNS) Type() string

type Direct

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

func NewDirect

func NewDirect(router adapter.Router, logger log.ContextLogger, tag string, options option.DirectOutboundOptions) (*Direct, error)

func (*Direct) Dependencies

func (a *Direct) Dependencies() []string

func (*Direct) DialContext

func (h *Direct) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Direct) DialParallel

func (h *Direct) DialParallel(ctx context.Context, network string, destination M.Socksaddr, destinationAddresses []netip.Addr) (net.Conn, error)

func (*Direct) ListenPacket

func (h *Direct) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Direct) Network

func (a *Direct) Network() []string

func (*Direct) NewConnection

func (h *Direct) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Direct) NewError

func (a *Direct) NewError(ctx context.Context, err error)

func (*Direct) NewPacketConnection

func (h *Direct) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Direct) Tag

func (a *Direct) Tag() string

func (*Direct) Type

func (a *Direct) Type() string

type HTTP

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

func NewHTTP

func NewHTTP(router adapter.Router, logger log.ContextLogger, tag string, options option.HTTPOutboundOptions) (*HTTP, error)

func (*HTTP) Dependencies

func (a *HTTP) Dependencies() []string

func (*HTTP) DialContext

func (h *HTTP) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*HTTP) ListenPacket

func (h *HTTP) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*HTTP) Network

func (a *HTTP) Network() []string

func (*HTTP) NewConnection

func (h *HTTP) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*HTTP) NewError

func (a *HTTP) NewError(ctx context.Context, err error)

func (*HTTP) NewPacketConnection

func (h *HTTP) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*HTTP) Tag

func (a *HTTP) Tag() string

func (*HTTP) Type

func (a *HTTP) Type() string

type LoadBalance

type LoadBalance struct {
	*balancer.Balancer
	// contains filtered or unexported fields
}

LoadBalance is a load balance group

func NewLoadBalance

func NewLoadBalance(router adapter.Router, logger log.ContextLogger, tag string, options option.LoadBalanceOutboundOptions) (*LoadBalance, error)

NewLoadBalance creates a new load balance outbound

func (*LoadBalance) All

func (s *LoadBalance) All() []string

All implements adapter.OutboundGroup

func (*LoadBalance) Close

func (s *LoadBalance) Close() error

Close implements adapter.Service

func (*LoadBalance) DialContext

func (s *LoadBalance) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

DialContext implements adapter.Outbound

func (*LoadBalance) ListenPacket

func (s *LoadBalance) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

ListenPacket implements adapter.Outbound

func (*LoadBalance) Network

func (s *LoadBalance) Network() []string

Network implements adapter.OutboundGroup

func (*LoadBalance) NewConnection

func (s *LoadBalance) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

NewConnection implements adapter.Outbound

func (*LoadBalance) NewPacketConnection

func (s *LoadBalance) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

NewPacketConnection implements adapter.Outbound

func (*LoadBalance) Now

func (s *LoadBalance) Now() string

Now implements adapter.OutboundGroup

func (*LoadBalance) Outbound

func (a *LoadBalance) Outbound(tag string) (adapter.Outbound, bool)

func (*LoadBalance) Outbounds

func (a *LoadBalance) Outbounds() []adapter.Outbound

func (*LoadBalance) Provider

func (a *LoadBalance) Provider(tag string) (adapter.Provider, bool)

func (*LoadBalance) Providers

func (a *LoadBalance) Providers() []adapter.Provider

func (*LoadBalance) Start

func (s *LoadBalance) Start() error

Start implements adapter.Service

type ProxyListener

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

func NewProxyListener

func NewProxyListener(ctx context.Context, logger log.ContextLogger, dialer N.Dialer) *ProxyListener

func (*ProxyListener) Close

func (l *ProxyListener) Close() error

func (*ProxyListener) NewConnection

func (l *ProxyListener) NewConnection(ctx context.Context, conn net.Conn, upstreamMetadata M.Metadata) error

func (*ProxyListener) NewPacketConnection

func (l *ProxyListener) NewPacketConnection(ctx context.Context, conn N.PacketConn, upstreamMetadata M.Metadata) error

func (*ProxyListener) Password

func (l *ProxyListener) Password() string

func (*ProxyListener) Port

func (l *ProxyListener) Port() uint16

func (*ProxyListener) Start

func (l *ProxyListener) Start() error

func (*ProxyListener) Username

func (l *ProxyListener) Username() string

type SSH

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

func NewSSH

func NewSSH(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.SSHOutboundOptions) (*SSH, error)

func (*SSH) Close

func (s *SSH) Close() error

func (*SSH) Dependencies

func (a *SSH) Dependencies() []string

func (*SSH) DialContext

func (s *SSH) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*SSH) InterfaceUpdated

func (s *SSH) InterfaceUpdated() error

func (*SSH) ListenPacket

func (s *SSH) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*SSH) Network

func (a *SSH) Network() []string

func (*SSH) NewConnection

func (s *SSH) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*SSH) NewError

func (a *SSH) NewError(ctx context.Context, err error)

func (*SSH) NewPacketConnection

func (s *SSH) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*SSH) Tag

func (a *SSH) Tag() string

func (*SSH) Type

func (a *SSH) Type() string

type Selector

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

func NewSelector

func NewSelector(router adapter.Router, logger log.ContextLogger, tag string, options option.SelectorOutboundOptions) (*Selector, error)

func (*Selector) All

func (a *Selector) All() []string

func (*Selector) DialContext

func (s *Selector) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Selector) ListenPacket

func (s *Selector) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Selector) Network

func (s *Selector) Network() []string

func (*Selector) NewConnection

func (s *Selector) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Selector) NewPacketConnection

func (s *Selector) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Selector) Now

func (s *Selector) Now() string

func (*Selector) Outbound

func (a *Selector) Outbound(tag string) (adapter.Outbound, bool)

func (*Selector) Outbounds

func (a *Selector) Outbounds() []adapter.Outbound

func (*Selector) Provider

func (a *Selector) Provider(tag string) (adapter.Provider, bool)

func (*Selector) Providers

func (a *Selector) Providers() []adapter.Provider

func (*Selector) SelectOutbound

func (s *Selector) SelectOutbound(tag string) bool

func (*Selector) Start

func (s *Selector) Start() error

type ShadowTLS

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

func NewShadowTLS

func NewShadowTLS(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.ShadowTLSOutboundOptions) (*ShadowTLS, error)

func (*ShadowTLS) Dependencies

func (a *ShadowTLS) Dependencies() []string

func (*ShadowTLS) DialContext

func (h *ShadowTLS) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*ShadowTLS) ListenPacket

func (h *ShadowTLS) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*ShadowTLS) Network

func (a *ShadowTLS) Network() []string

func (*ShadowTLS) NewConnection

func (h *ShadowTLS) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*ShadowTLS) NewError

func (a *ShadowTLS) NewError(ctx context.Context, err error)

func (*ShadowTLS) NewPacketConnection

func (h *ShadowTLS) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*ShadowTLS) Tag

func (a *ShadowTLS) Tag() string

func (*ShadowTLS) Type

func (a *ShadowTLS) Type() string

type Shadowsocks

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

func NewShadowsocks

func NewShadowsocks(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.ShadowsocksOutboundOptions) (*Shadowsocks, error)

func (*Shadowsocks) Close

func (h *Shadowsocks) Close() error

func (*Shadowsocks) Dependencies

func (a *Shadowsocks) Dependencies() []string

func (*Shadowsocks) DialContext

func (h *Shadowsocks) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Shadowsocks) InterfaceUpdated

func (h *Shadowsocks) InterfaceUpdated() error

func (*Shadowsocks) ListenPacket

func (h *Shadowsocks) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Shadowsocks) Network

func (a *Shadowsocks) Network() []string

func (*Shadowsocks) NewConnection

func (h *Shadowsocks) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Shadowsocks) NewError

func (a *Shadowsocks) NewError(ctx context.Context, err error)

func (*Shadowsocks) NewPacketConnection

func (h *Shadowsocks) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Shadowsocks) Tag

func (a *Shadowsocks) Tag() string

func (*Shadowsocks) Type

func (a *Shadowsocks) Type() string

type Socks

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

func NewSocks

func NewSocks(router adapter.Router, logger log.ContextLogger, tag string, options option.SocksOutboundOptions) (*Socks, error)

func (*Socks) Dependencies

func (a *Socks) Dependencies() []string

func (*Socks) DialContext

func (h *Socks) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Socks) ListenPacket

func (h *Socks) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Socks) Network

func (a *Socks) Network() []string

func (*Socks) NewConnection

func (h *Socks) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Socks) NewError

func (a *Socks) NewError(ctx context.Context, err error)

func (*Socks) NewPacketConnection

func (h *Socks) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Socks) Tag

func (a *Socks) Tag() string

func (*Socks) Type

func (a *Socks) Type() string

type Tor

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

func NewTor

func NewTor(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.TorOutboundOptions) (*Tor, error)

func (*Tor) Close

func (t *Tor) Close() error

func (*Tor) Dependencies

func (a *Tor) Dependencies() []string

func (*Tor) DialContext

func (t *Tor) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Tor) ListenPacket

func (t *Tor) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Tor) Network

func (a *Tor) Network() []string

func (*Tor) NewConnection

func (t *Tor) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Tor) NewError

func (a *Tor) NewError(ctx context.Context, err error)

func (*Tor) NewPacketConnection

func (t *Tor) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Tor) Start

func (t *Tor) Start() error

func (*Tor) Tag

func (a *Tor) Tag() string

func (*Tor) Type

func (a *Tor) Type() string

type Trojan

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

func NewTrojan

func NewTrojan(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.TrojanOutboundOptions) (*Trojan, error)

func (*Trojan) Close

func (h *Trojan) Close() error

func (*Trojan) Dependencies

func (a *Trojan) Dependencies() []string

func (*Trojan) DialContext

func (h *Trojan) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*Trojan) InterfaceUpdated

func (h *Trojan) InterfaceUpdated() error

func (*Trojan) ListenPacket

func (h *Trojan) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*Trojan) Network

func (a *Trojan) Network() []string

func (*Trojan) NewConnection

func (h *Trojan) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*Trojan) NewError

func (a *Trojan) NewError(ctx context.Context, err error)

func (*Trojan) NewPacketConnection

func (h *Trojan) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Trojan) Tag

func (a *Trojan) Tag() string

func (*Trojan) Type

func (a *Trojan) Type() string

type URLTest

type URLTest struct {
	*healthcheck.HealthCheck
	// contains filtered or unexported fields
}

func NewURLTest

func NewURLTest(router adapter.Router, logger log.ContextLogger, tag string, options option.URLTestOutboundOptions) (*URLTest, error)

func (*URLTest) All

func (a *URLTest) All() []string

func (URLTest) Close

func (s URLTest) Close() error

func (*URLTest) DialContext

func (s *URLTest) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*URLTest) Fallback

func (s *URLTest) Fallback(used adapter.Outbound) []adapter.Outbound

func (*URLTest) ListenPacket

func (s *URLTest) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*URLTest) Network

func (s *URLTest) Network() []string

func (*URLTest) NewConnection

func (s *URLTest) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*URLTest) NewPacketConnection

func (s *URLTest) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*URLTest) Now

func (s *URLTest) Now() string

func (*URLTest) Outbound

func (a *URLTest) Outbound(tag string) (adapter.Outbound, bool)

func (*URLTest) Outbounds

func (a *URLTest) Outbounds() []adapter.Outbound

func (*URLTest) Provider

func (a *URLTest) Provider(tag string) (adapter.Provider, bool)

func (*URLTest) Providers

func (a *URLTest) Providers() []adapter.Provider

func (*URLTest) Select

func (s *URLTest) Select(network string) (adapter.Outbound, error)

func (*URLTest) Start

func (s *URLTest) Start() error

type VLESS

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

func NewVLESS

func NewVLESS(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.VLESSOutboundOptions) (*VLESS, error)

func (*VLESS) Close

func (h *VLESS) Close() error

func (*VLESS) Dependencies

func (a *VLESS) Dependencies() []string

func (*VLESS) DialContext

func (h *VLESS) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*VLESS) InterfaceUpdated

func (h *VLESS) InterfaceUpdated() error

func (*VLESS) ListenPacket

func (h *VLESS) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*VLESS) Network

func (a *VLESS) Network() []string

func (*VLESS) NewConnection

func (h *VLESS) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*VLESS) NewError

func (a *VLESS) NewError(ctx context.Context, err error)

func (*VLESS) NewPacketConnection

func (h *VLESS) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*VLESS) Tag

func (a *VLESS) Tag() string

func (*VLESS) Type

func (a *VLESS) Type() string

type VMess

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

func NewVMess

func NewVMess(ctx context.Context, router adapter.Router, logger log.ContextLogger, tag string, options option.VMessOutboundOptions) (*VMess, error)

func (*VMess) Close

func (h *VMess) Close() error

func (*VMess) Dependencies

func (a *VMess) Dependencies() []string

func (*VMess) DialContext

func (h *VMess) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, error)

func (*VMess) InterfaceUpdated

func (h *VMess) InterfaceUpdated() error

func (*VMess) ListenPacket

func (h *VMess) ListenPacket(ctx context.Context, destination M.Socksaddr) (net.PacketConn, error)

func (*VMess) Network

func (a *VMess) Network() []string

func (*VMess) NewConnection

func (h *VMess) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

func (*VMess) NewError

func (a *VMess) NewError(ctx context.Context, err error)

func (*VMess) NewPacketConnection

func (h *VMess) NewPacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*VMess) Tag

func (a *VMess) Tag() string

func (*VMess) Type

func (a *VMess) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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