mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Windows CI: Allow npipe protocol for sock requests
Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
parent
508a17baba
commit
08b65e7dd3
3 changed files with 26 additions and 0 deletions
|
@ -577,6 +577,8 @@ func sockConn(timeout time.Duration) (net.Conn, error) {
|
|||
|
||||
var c net.Conn
|
||||
switch daemonURL.Scheme {
|
||||
case "npipe":
|
||||
return npipeDial(daemonURL.Path, timeout)
|
||||
case "unix":
|
||||
return net.DialTimeout(daemonURL.Scheme, daemonURL.Path, timeout)
|
||||
case "tcp":
|
||||
|
|
12
integration-cli/npipe.go
Normal file
12
integration-cli/npipe.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
// +build !windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func npipeDial(path string, timeout time.Duration) (net.Conn, error) {
|
||||
panic("npipe protocol only supported on Windows")
|
||||
}
|
12
integration-cli/npipe_windows.go
Normal file
12
integration-cli/npipe_windows.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
)
|
||||
|
||||
func npipeDial(path string, timeout time.Duration) (net.Conn, error) {
|
||||
return winio.DialPipe(path, &timeout)
|
||||
}
|
Loading…
Reference in a new issue