bridge

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: GPL-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOutbound

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

func RegisterOutbound

func RegisterOutbound(registry *outbound.Registry)

Types

type Backend

type Backend interface {
	adapter.Lifecycle
	tun.Port
}

type Outbound

type Outbound struct {
	outbound.Adapter
	// contains filtered or unexported fields
}

func (*Outbound) AttachReturn

func (o *Outbound) AttachReturn(returnPath tun.Return) error

func (*Outbound) Close

func (o *Outbound) Close() error

func (*Outbound) DetachReturn

func (o *Outbound) DetachReturn(returnPath tun.Return) error

func (*Outbound) DialContext

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

func (*Outbound) ListenPacket

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

func (*Outbound) PortAddresses

func (o *Outbound) PortAddresses() (netip.Addr, netip.Addr)

func (*Outbound) PortMTU

func (o *Outbound) PortMTU() uint32

func (*Outbound) PortSelectorRange

func (o *Outbound) PortSelectorRange() (uint16, uint16)

func (*Outbound) PreMatchFlow

func (o *Outbound) PreMatchFlow(network string, destination netip.Addr) adapter.PreMatchAction

func (*Outbound) PreferredAddress

func (o *Outbound) PreferredAddress(metadata *adapter.InboundContext, address netip.Addr) bool

func (*Outbound) PreferredDomain

func (o *Outbound) PreferredDomain(metadata *adapter.InboundContext, domain string) bool

func (*Outbound) Start

func (o *Outbound) Start(stage adapter.StartStage) error

func (*Outbound) WritePackets

func (o *Outbound) WritePackets(packets [][]byte) error

type Service

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

func NewService

func NewService(options ServiceOptions) (*Service, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) FileDescriptor

func (s *Service) FileDescriptor() int

func (*Service) Inet6Active

func (s *Service) Inet6Active() bool

func (*Service) Name

func (s *Service) Name() string

func (*Service) SetEgress

func (s *Service) SetEgress(interfaceName string) error

type ServiceOptions

type ServiceOptions struct {
	BridgeName string
	MTU        int
	Inet4Port  netip.Addr
	Inet6Port  netip.Addr
	RuleIndex  int
	RouteTable int
	Logger     logger.ContextLogger
}

Jump to

Keyboard shortcuts

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