mirror of https://github.com/v2ray/v2ray-core
parent
8fe53261cc
commit
b9dddd0586
@ -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
|
||||
|
||||
}
|
||||
|
Loading…
Reference in new issue