2018-02-05 21:05:59 +00:00
|
|
|
package client // import "github.com/docker/docker/client"
|
2017-05-15 19:59:15 +00:00
|
|
|
|
|
|
|
import (
|
2018-04-19 22:30:59 +00:00
|
|
|
"context"
|
2017-05-15 19:59:15 +00:00
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DialSession returns a connection that can be used communication with daemon
|
|
|
|
func (cli *Client) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) {
|
|
|
|
req, err := http.NewRequest("POST", "/session", nil)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
req = cli.addHeaders(req, meta)
|
|
|
|
|
2018-03-19 08:33:06 +00:00
|
|
|
return cli.setupHijackConn(ctx, req, proto)
|
2017-05-15 19:59:15 +00:00
|
|
|
}
|