github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/transport/internet/udp/dialer.go (about) 1 package udp 2 3 import ( 4 "context" 5 6 "v2ray.com/core/common" 7 "v2ray.com/core/common/net" 8 "v2ray.com/core/transport/internet" 9 ) 10 11 func init() { 12 common.Must(internet.RegisterTransportDialer(protocolName, 13 func(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) { 14 var sockopt *internet.SocketConfig 15 if streamSettings != nil { 16 sockopt = streamSettings.SocketSettings 17 } 18 conn, err := internet.DialSystem(ctx, dest, sockopt) 19 if err != nil { 20 return nil, err 21 } 22 // TODO: handle dialer options 23 return internet.Connection(conn), nil 24 })) 25 }