2017-07-11 17:12:12 +00:00
|
|
|
package grpchijack
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
|
|
|
|
controlapi "github.com/moby/buildkit/api/services/control"
|
|
|
|
"google.golang.org/grpc/metadata"
|
|
|
|
)
|
|
|
|
|
2018-01-06 16:54:10 +00:00
|
|
|
func Hijack(stream controlapi.Control_SessionServer) (net.Conn, <-chan struct{}, map[string][]string) {
|
2017-11-17 21:34:42 +00:00
|
|
|
md, _ := metadata.FromIncomingContext(stream.Context())
|
2018-01-06 16:54:10 +00:00
|
|
|
c, closeCh := streamToConn(stream)
|
|
|
|
return c, closeCh, md
|
2017-07-11 17:12:12 +00:00
|
|
|
}
|