helper

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnableSpliceCopy = "0"

EnableSpliceCopy turns on Linux splice/zero-copy relay when set to "1"/"true"/"on"/"yes". Off by default. Set at build time:

go build -ldflags "-X github.com/5vnetwork/vx-core/proxy/helper.EnableSpliceCopy=1"

Runtime override (takes precedence when set): VX_ENABLE_SPLICE=1

Functions

func GetLinks(network net.Network, userLevel uint32, policy i.BufferPolicy) (*pipe.Link, *pipe.Link)

func Relay

func Relay(ctx context.Context, leftReader buf.Reader, leftWriter buf.Writer,
	rightReader buf.Reader, rightWriter buf.Writer) error

read from leftReader, write to rightWriter, read from rightReader, write to leftWriter. When any direction met an error, returns the error. When both directions return nil, the function returns nil.

func RelayConn

func RelayConn(ctx context.Context, left, right net.Conn) error

read from leftReader, write to rightWriter, read from rightReader, write to leftWriter. When any direction met an error, returns the error. When both directions return nil, the function returns nil.

func RelayUDPPacketConn

func RelayUDPPacketConn(ctx context.Context, left udp.PacketReaderWriter, right udp.PacketReaderWriter) error

func UseSpliceCopy added in v1.6.0

func UseSpliceCopy() bool

UseSpliceCopy reports whether Linux splice copy should be used for relay.

Types

This section is empty.

Jump to

Keyboard shortcuts

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