1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-03 07:56:42 -05:00

Added Dialer stub

This commit is contained in:
Shelikhoo 2017-11-22 21:53:22 +08:00
parent 8fe53261cc
commit b9dddd0586
No known key found for this signature in database
GPG Key ID: C4D5E79D22B25316

View File

@ -1,7 +1,19 @@
package domainsocket
import "context"
import (
"context"
"net"
)
func DialDS(ctx context.Context, path string) {
func DialDS(ctx context.Context, path string) (*net.UnixConn, error) {
resolvedAddress, err := net.ResolveUnixAddr("unixpacket", path)
if err != nil {
return nil, err
}
dialedUnix, err := net.DialUnix("unixpacket", nil, resolvedAddress)
if err != nil {
return nil, err
}
return dialedUnix, nil
}