outbound

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: GPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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, options option.Outbound) (adapter.Outbound, error)

func NewConnection

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

func NewEarlyConnection

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

func NewPacketConnection

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

func RealTag

func RealTag(detour adapter.Outbound) string

Types

type Block

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

func NewBlock

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

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) 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) 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) 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

func (*Direct) DialContext

func (h *Direct) DialContext(ctx context.Context, network string, destination M.Socksaddr) (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) 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) 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) 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 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 (s *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) SelectOutbound

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

func (*Selector) Start

func (s *Selector) Start() error

func (*Selector) Tag

func (a *Selector) Tag() string

func (*Selector) Type

func (a *Selector) 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) DialContext

func (h *Shadowsocks) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, 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) 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) 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) 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 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) DialContext

func (h *Trojan) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, 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) 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 TrojanDialer

type TrojanDialer Trojan

func (*TrojanDialer) DialContext

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

func (*TrojanDialer) ListenPacket

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

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) DialContext

func (h *VMess) DialContext(ctx context.Context, network string, destination M.Socksaddr) (net.Conn, 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) 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

Jump to

Keyboard shortcuts

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