github.com/lazyboychen7/engine@v17.12.1-ce-rc2+incompatible/client/session.go (about) 1 package client 2 3 import ( 4 "net" 5 "net/http" 6 7 "golang.org/x/net/context" 8 ) 9 10 // DialSession returns a connection that can be used communication with daemon 11 func (cli *Client) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) { 12 req, err := http.NewRequest("POST", "/session", nil) 13 if err != nil { 14 return nil, err 15 } 16 req = cli.addHeaders(req, meta) 17 18 return cli.setupHijackConn(req, proto) 19 }