freedom

package
v0.2.0-dev Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PluggableOutboundKey contextKey = "freedom_pluggable_outbound"

Variables

This section is empty.

Functions

func GetPluggableOutbound

func GetPluggableOutbound(ctx context.Context) (C.Outbound, bool)

从Context获取接口对象

func NewPacketReader

func NewPacketReader(conn net.Conn, UDPOverride net.Destination) buf.Reader

func NewPacketWriter

func NewPacketWriter(conn net.Conn, h *Handler, ctx context.Context, UDPOverride net.Destination) buf.Writer

func WithPluggableOutbound

func WithPluggableOutbound(ctx context.Context, outbound C.Outbound) context.Context

创建带接口对象的Context

Types

type Handler

type Handler struct{}

Handler handles Freedom connections.

func (*Handler) Process

func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error

Process implements proxy.Outbound.

type PacketReader

type PacketReader struct {
	*internet.PacketConnWrapper
	stats.Counter
}

func (*PacketReader) ReadMultiBuffer

func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error)

type PacketWriter

type PacketWriter struct {
	*internet.PacketConnWrapper
	stats.Counter
	*Handler
	context.Context
	UDPOverride net.Destination
}

func (*PacketWriter) WriteMultiBuffer

func (w *PacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error

Jump to

Keyboard shortcuts

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