udp

package
v2.10.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadUDPMsg added in v1.24.4

func ReadUDPMsg(conn *net.UDPConn, payload []byte, oob []byte) (int, int, int, *net.UDPAddr, error)

func RetrieveOriginalDest added in v1.24.2

func RetrieveOriginalDest(oob []byte) v2net.Destination

func SetOriginalDestOptions added in v1.24.2

func SetOriginalDestOptions(fd int) error

Types

type Connection

type Connection struct {
	net.UDPConn
}

func (*Connection) Reusable

func (v *Connection) Reusable() bool

func (*Connection) SetReusable

func (v *Connection) SetReusable(b bool)

type ListenOption added in v1.24.2

type ListenOption struct {
	Callback            UDPPayloadHandler
	ReceiveOriginalDest bool
	Concurrency         int
}

type TimedInboundRay

type TimedInboundRay struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTimedInboundRay

func NewTimedInboundRay(name string, inboundRay ray.InboundRay, server *UDPServer) *TimedInboundRay

func (*TimedInboundRay) InboundInput

func (v *TimedInboundRay) InboundInput() ray.OutputStream

func (*TimedInboundRay) InboundOutput

func (v *TimedInboundRay) InboundOutput() ray.InputStream

func (*TimedInboundRay) Monitor

func (v *TimedInboundRay) Monitor()

func (*TimedInboundRay) Release

func (v *TimedInboundRay) Release()

type UDPHub

type UDPHub struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func ListenUDP

func ListenUDP(address v2net.Address, port v2net.Port, option ListenOption) (*UDPHub, error)

func (*UDPHub) Addr added in v1.24.2

func (v *UDPHub) Addr() net.Addr

func (*UDPHub) Close

func (v *UDPHub) Close()

func (*UDPHub) Connection added in v1.24.2

func (v *UDPHub) Connection() net.Conn

Connection return the net.Conn underneath v hub. Private: Visible for testing only

func (*UDPHub) Running added in v1.21.1

func (v *UDPHub) Running() bool

func (*UDPHub) WriteTo

func (v *UDPHub) WriteTo(payload []byte, dest v2net.Destination) (int, error)

type UDPPayload

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

type UDPPayloadHandler

type UDPPayloadHandler func(*buf.Buffer, *proxy.SessionInfo)

type UDPPayloadQueue

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

func NewUDPPayloadQueue

func NewUDPPayloadQueue(option ListenOption) *UDPPayloadQueue

func (*UDPPayloadQueue) Close

func (v *UDPPayloadQueue) Close()

func (*UDPPayloadQueue) Dequeue

func (v *UDPPayloadQueue) Dequeue(queue <-chan UDPPayload)

func (*UDPPayloadQueue) Enqueue

func (v *UDPPayloadQueue) Enqueue(payload UDPPayload)

type UDPResponseCallback

type UDPResponseCallback func(destination v2net.Destination, payload *buf.Buffer)

type UDPServer

type UDPServer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewUDPServer

func NewUDPServer(packetDispatcher dispatcher.PacketDispatcher) *UDPServer

func (*UDPServer) Dispatch

func (v *UDPServer) Dispatch(session *proxy.SessionInfo, payload *buf.Buffer, callback UDPResponseCallback)

func (*UDPServer) RemoveRay

func (v *UDPServer) RemoveRay(name string)

Jump to

Keyboard shortcuts

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