Documentation ¶
Index ¶
- func BindToInterface0(finder InterfaceFinder, conn syscall.RawConn, network string, address string, ...) error
- func Conn(conn syscall.Conn, block func(fd uintptr) error) error
- func Conn0[T any](conn syscall.Conn, block func(fd uintptr) (T, error)) (T, error)
- func GetOriginalDestination(conn net.Conn) (netip.AddrPort, error)
- func GetOriginalDestinationFromOOB(oob []byte) (netip.AddrPort, error)
- func Raw(rawConn syscall.RawConn, block func(fd uintptr) error) error
- func Raw0[T any](rawConn syscall.RawConn, block func(fd uintptr) (T, error)) (T, error)
- func TProxy(fd uintptr, family int) error
- type DefaultInterfaceFinder
- func (f *DefaultInterfaceFinder) ByAddr(addr netip.Addr) (*Interface, error)
- func (f *DefaultInterfaceFinder) ByIndex(index int) (*Interface, error)
- func (f *DefaultInterfaceFinder) ByName(name string) (*Interface, error)
- func (f *DefaultInterfaceFinder) Interfaces() []Interface
- func (f *DefaultInterfaceFinder) Update() error
- func (f *DefaultInterfaceFinder) UpdateInterfaces(interfaces []Interface)
- type Func
- func Append(oldFunc Func, newFunc Func) Func
- func BindToInterface(finder InterfaceFinder, interfaceName string, interfaceIndex int) Func
- func BindToInterfaceFunc(finder InterfaceFinder, ...) Func
- func DisableUDPFragment() Func
- func ProtectPath(protectPath string) Func
- func ReuseAddr() Func
- func RoutingMark(mark uint32) Func
- func SetKeepAlivePeriod(idle time.Duration, interval time.Duration) Func
- func TProxyWriteBack() Func
- type Interface
- type InterfaceFinder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindToInterface0 ¶
func GetOriginalDestination ¶ added in v0.5.0
func GetOriginalDestinationFromOOB ¶ added in v0.5.0
Types ¶
type DefaultInterfaceFinder ¶
type DefaultInterfaceFinder struct {
// contains filtered or unexported fields
}
func NewDefaultInterfaceFinder ¶ added in v0.4.0
func NewDefaultInterfaceFinder() *DefaultInterfaceFinder
func (*DefaultInterfaceFinder) ByAddr ¶
func (f *DefaultInterfaceFinder) ByAddr(addr netip.Addr) (*Interface, error)
func (*DefaultInterfaceFinder) ByIndex ¶
func (f *DefaultInterfaceFinder) ByIndex(index int) (*Interface, error)
func (*DefaultInterfaceFinder) ByName ¶
func (f *DefaultInterfaceFinder) ByName(name string) (*Interface, error)
func (*DefaultInterfaceFinder) Interfaces ¶ added in v0.5.0
func (f *DefaultInterfaceFinder) Interfaces() []Interface
func (*DefaultInterfaceFinder) Update ¶ added in v0.4.0
func (f *DefaultInterfaceFinder) Update() error
func (*DefaultInterfaceFinder) UpdateInterfaces ¶ added in v0.4.0
func (f *DefaultInterfaceFinder) UpdateInterfaces(interfaces []Interface)
type Func ¶
func BindToInterface ¶
func BindToInterface(finder InterfaceFinder, interfaceName string, interfaceIndex int) Func
func BindToInterfaceFunc ¶
func DisableUDPFragment ¶
func DisableUDPFragment() Func
func ProtectPath ¶
func RoutingMark ¶
func SetKeepAlivePeriod ¶ added in v0.4.0
func TProxyWriteBack ¶ added in v0.5.0
func TProxyWriteBack() Func
type Interface ¶ added in v0.4.0
type Interface struct { Index int MTU int Name string HardwareAddr net.HardwareAddr Flags net.Flags Addresses []netip.Prefix }
func InterfaceFromNetAddrs ¶
func (Interface) NetInterface ¶
Click to show internal directories.
Click to hide internal directories.