udp

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: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUDPDialer

func NewUDPDialer(s string, d proxy.Dialer) (proxy.Dialer, error)

NewUDPDialer returns a udp dialer.

func NewUDPServer

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

NewUDPServer returns a udp transport layer before the real server.

Types

type PktConn added in v0.16.0

type PktConn struct {
	net.PacketConn
	// contains filtered or unexported fields
}

PktConn .

func (*PktConn) WriteTo added in v0.16.0

func (pc *PktConn) WriteTo(b []byte, addr net.Addr) (int, error)

WriteTo overrides the original function from net.PacketConn.

type UDP

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

UDP struct.

func NewUDP

func NewUDP(s string, d proxy.Dialer, p proxy.Proxy) (*UDP, error)

NewUDP returns a udp struct.

func (*UDP) Addr

func (s *UDP) Addr() string

Addr returns forwarder's address.

func (*UDP) Dial

func (s *UDP) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net via the proxy.

func (*UDP) DialUDP

func (s *UDP) DialUDP(network, addr string) (net.PacketConn, error)

DialUDP connects to the given address via the proxy.

func (*UDP) ListenAndServe

func (s *UDP) ListenAndServe()

ListenAndServe listens on server's addr and serves connections.

func (*UDP) Serve

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

Serve serves a connection.

Jump to

Keyboard shortcuts

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