This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/solver/socketprovider_windows.go
Sam Alba e4f2f69353 solver: fixed npipe support on Windows
Signed-off-by: Sam Alba <samalba@users.noreply.github.com>
2021-11-10 17:25:02 -08:00

24 lines
385 B
Go

//go:build windows
// +build windows
package solver
import (
"fmt"
"net"
"strings"
"time"
"github.com/Microsoft/go-winio"
)
func dialStream(id string) (net.Conn, error) {
if !strings.HasPrefix(id, npipePrefix) {
return nil, fmt.Errorf("invalid socket forward key %s", id)
}
id = strings.TrimPrefix(id, npipePrefix)
dur := time.Second
return winio.DialPipe(id, &dur)
}