1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-13 11:20:42 +00:00
v2fly/transport/internet/udp/dialer.go
2018-09-18 23:09:54 +02:00

22 lines
457 B
Go

package udp
import (
"context"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/transport/internet"
)
func init() {
common.Must(internet.RegisterTransportDialer(protocolName,
func(ctx context.Context, dest net.Destination) (internet.Connection, error) {
conn, err := internet.DialSystem(ctx, dest)
if err != nil {
return nil, err
}
// TODO: handle dialer options
return internet.Connection(conn), nil
}))
}