tproxy

package module
v0.0.0-...-3279d5e Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 8 Imported by: 0

README

tproxy

Golang TPROXY and REDIRECT library, support IPv4 and IPv6, support TCP and UDP. (REDIRECT not support UDP)

Documentation

Index

Constants

View Source
const SO_ORIGINAL_DST = 80

SO_ORIGINAL_DST syscall and unix not contain

Variables

This section is empty.

Functions

func ListenTCP

func ListenTCP(addr string) (_ net.Listener, err error)

ListenTCP address is [::], dual stack

Types

type UDPListener

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

UDPListener normal and TPROXY listener

func ListenUDP

func ListenUDP(addr string) (udpListener *UDPListener, err error)

ListenUDP like net package

func (*UDPListener) Close

func (u *UDPListener) Close() (err error)

Close like net package

func (*UDPListener) LocalAddr

func (u *UDPListener) LocalAddr() net.Addr

LocalAddr returns the local network address, if known.

func (*UDPListener) ReadFromUDPAddrPort

func (u *UDPListener) ReadFromUDPAddrPort(buf []byte) (nread int, saddr, daddr netip.AddrPort, err error)

ReadFromUDPAddrPort like net package

func (*UDPListener) WriteToUDPAddrPort

func (u *UDPListener) WriteToUDPAddrPort(buf []byte, saddr, daddr netip.AddrPort) (err error)

WriteToUDPAddrPort like net package

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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