v2ray-core: github.com/v2ray/v2ray-core/transport/internet/udp Index | Files

package udp

import "github.com/v2ray/v2ray-core/transport/internet/udp"

Index

Package Files

config.go config.pb.go dialer.go dispatcher.go errors.generated.go hub.go hub_linux.go udp.go

Variables

var File_transport_internet_udp_config_proto protoreflect.FileDescriptor

func DialDispatcher Uses

func DialDispatcher(ctx context.Context, dispatcher routing.Dispatcher) (net.PacketConn, error)

func ReadUDPMsg Uses

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

func RetrieveOriginalDest Uses

func RetrieveOriginalDest(oob []byte) net.Destination

type Config Uses

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

func (*Config) Descriptor Uses

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) ProtoMessage Uses

func (*Config) ProtoMessage()

func (*Config) ProtoReflect Uses

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset Uses

func (x *Config) Reset()

func (*Config) String Uses

func (x *Config) String() string

type Dispatcher Uses

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

func NewDispatcher Uses

func NewDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) *Dispatcher

func (*Dispatcher) Dispatch Uses

func (v *Dispatcher) Dispatch(ctx context.Context, destination net.Destination, payload *buf.Buffer)

func (*Dispatcher) RemoveRay Uses

func (v *Dispatcher) RemoveRay(dest net.Destination)

type Hub Uses

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

func ListenUDP Uses

func ListenUDP(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, options ...HubOption) (*Hub, error)

func (*Hub) Addr Uses

func (h *Hub) Addr() net.Addr

Addr implements net.Listener.

func (*Hub) Close Uses

func (h *Hub) Close() error

Close implements net.Listener.

func (*Hub) Receive Uses

func (h *Hub) Receive() <-chan *udp.Packet

func (*Hub) WriteTo Uses

func (h *Hub) WriteTo(payload []byte, dest net.Destination) (int, error)

type HubOption Uses

type HubOption func(h *Hub)

func HubCapacity Uses

func HubCapacity(capacity int) HubOption

func HubReceiveOriginalDestination Uses

func HubReceiveOriginalDestination(r bool) HubOption

type ResponseCallback Uses

type ResponseCallback func(ctx context.Context, packet *udp.Packet)

Package udp imports 21 packages (graph) and is imported by 2 packages. Updated 2020-11-03. Refresh now. Tools for package owners.