outbound

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIpv6NotSupported = errors.New("ipv6 not supported")

Functions

This section is empty.

Types

type HandlerObserver

type HandlerObserver interface {
	OnHandlerChanged()
}

type HandlerWithStats

type HandlerWithStats struct {
	i.Outbound
	Stats *OutboundHandlerStats
}

func (*HandlerWithStats) GetHandlerStats

func (i *HandlerWithStats) GetHandlerStats() *OutboundHandlerStats

type HandlerWithSupport6Info

type HandlerWithSupport6Info struct {
	i.Outbound
	util.IPv6SupportChangeNotifier
	// contains filtered or unexported fields
}

func NewHandlerWithSupport6Info added in v1.0.7

func NewHandlerWithSupport6Info(outbound i.Outbound, support6 bool) *HandlerWithSupport6Info

func (*HandlerWithSupport6Info) SetSupport6

func (h *HandlerWithSupport6Info) SetSupport6(support6 bool)

func (*HandlerWithSupport6Info) Support6

func (h *HandlerWithSupport6Info) Support6() bool

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

holds all outbound handlers. notify its listeners when a change happens.

func NewManager

func NewManager() *Manager

func (*Manager) AddHandlerObserver

func (m *Manager) AddHandlerObserver(o HandlerObserver)

func (*Manager) AddHandlers

func (m *Manager) AddHandlers(handlers ...i.Outbound) error

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) GetAllHandlers

func (m *Manager) GetAllHandlers() []i.Outbound

func (*Manager) GetHandler

func (m *Manager) GetHandler(tag string) i.Outbound

func (*Manager) RemoveHandlerObserver

func (m *Manager) RemoveHandlerObserver(observer HandlerObserver)

func (*Manager) RemoveHandlers

func (m *Manager) RemoveHandlers(tags []string) error

func (*Manager) ReplaceHandlers

func (m *Manager) ReplaceHandlers(handlers []i.Outbound)

replace all handlers with new ones

func (*Manager) Start

func (m *Manager) Start() error

type OnHandlerChangedFunc

type OnHandlerChangedFunc func()

func (OnHandlerChangedFunc) OnHandlerChanged

func (f OnHandlerChangedFunc) OnHandlerChanged()

type OutStats

type OutStats struct {
	sync.Mutex
	Map map[string]*OutboundHandlerStats
}

func NewOutStats

func NewOutStats() *OutStats

func (*OutStats) CleanOldStats

func (o *OutStats) CleanOldStats()

func (*OutStats) Get

func (o *OutStats) Get(tag string) *OutboundHandlerStats

type OutboundHandlerStats

type OutboundHandlerStats struct {
	UpCounter   atomic.Uint64
	DownCounter atomic.Uint64
	Interval    atomic.Value

	Throughput atomic.Uint64
	Ping       atomic.Uint64
	Time       atomic.Value
}

func NewHandlerStats

func NewHandlerStats(throughput uint64, ping uint64) *OutboundHandlerStats

func (*OutboundHandlerStats) AddPing

func (s *OutboundHandlerStats) AddPing(v uint64)

func (*OutboundHandlerStats) AddThroughput

func (s *OutboundHandlerStats) AddThroughput(v uint64)

type ProxyHandler

type ProxyHandler struct {
	i.Handler
	// contains filtered or unexported fields
}

implement outbound.ProxyHandler and transport.Dialer

func NewProxyHandler

func NewProxyHandler(settings ProxyHandlerSettings) *ProxyHandler

func (*ProxyHandler) Close

func (h *ProxyHandler) Close() error

func (*ProxyHandler) HandleFlow

func (h *ProxyHandler) HandleFlow(ctx context.Context, dst net.Destination, rw buf.ReaderWriter) error

func (*ProxyHandler) HandlePacketConn

func (h *ProxyHandler) HandlePacketConn(ctx context.Context, dst net.Destination,
	rw udp.PacketReaderWriter) error

func (*ProxyHandler) Start

func (h *ProxyHandler) Start() error

func (*ProxyHandler) Tag

func (h *ProxyHandler) Tag() string

type ProxyHandlerSettings

type ProxyHandlerSettings struct {
	Tag       string
	Handler   i.Handler
	Uot       bool
	EnableMux bool
	MuxConfig mux.ClientStrategy
}

type RandomPortSelector

type RandomPortSelector struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRandomPortSelector

func NewRandomPortSelector(ranges []*net.PortRange) *RandomPortSelector

func (*RandomPortSelector) SelectPort

func (s *RandomPortSelector) SelectPort() uint16

randomly select one enabled port from the list

Jump to

Keyboard shortcuts

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