tproxy

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenPacket added in v0.15.0

func ListenPacket(addr *net.UDPAddr) (net.PacketConn, error)

ListenPacket acts like net.ListenPacket but the addr could be non-local.

func ListenUDP added in v0.15.0

func ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)

ListenUDP acts like net.ListenUDP but returns an conn with IP_TRANSPARENT option.

func NewTProxyServer

func NewTProxyServer(s string, p proxy.Proxy) (proxy.Server, error)

NewTProxyServer returns a udp tunnel server.

func ReadFromUDP

func ReadFromUDP(conn *net.UDPConn, b []byte) (int, *net.UDPAddr, *net.UDPAddr, error)

ReadFromUDP reads a UDP packet from c, copying the payload into b. It returns the number of bytes copied into b and the return address that was on the packet.

Out-of-band data is also read in so that the original destination address can be identified and parsed.

Types

type TProxy

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

TProxy struct.

func NewTProxy

func NewTProxy(s string, p proxy.Proxy) (*TProxy, error)

NewTProxy returns a tproxy.

func (*TProxy) ListenAndServe

func (s *TProxy) ListenAndServe()

ListenAndServe listens on server's addr and serves connections.

func (*TProxy) ListenAndServeTCP

func (s *TProxy) ListenAndServeTCP()

ListenAndServeTCP listens and serves tcp.

func (*TProxy) ListenAndServeUDP

func (s *TProxy) ListenAndServeUDP()

ListenAndServeUDP listens and serves udp.

func (*TProxy) Serve added in v0.6.9

func (s *TProxy) Serve(c net.Conn)

Serve serves tcp conn.

Jump to

Keyboard shortcuts

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