removed hard-coded http in Docker client

This commit is contained in:
Brad Rydzewski 2014-10-20 22:52:34 -07:00
parent f4aa84a057
commit 505ebe7024

View file

@ -175,6 +175,9 @@ func (c *Client) do(method, path string, in, out interface{}) error {
// dial the host server
req.URL.Host = c.addr
req.URL.Scheme = "http"
if c.tls != nil {
req.URL.Scheme = "https"
}
resp, err := c.HTTPClient().Do(req)
if err != nil {
@ -272,26 +275,12 @@ func (c *Client) stream(method, path string, in io.Reader, out io.Writer, header
req.Header.Set("User-Agent", "Docker-Client/0.6.4")
req.Header.Set("Content-Type", "plain/text")
// dial the host server
/*
req.Host = c.addr
dial, err := net.Dial(c.proto, c.addr)
if err != nil {
return err
}
// make the request
conn := httputil.NewClientConn(dial, nil)
resp, err := conn.Do(req)
defer conn.Close()
if err != nil {
return err
}
*/
// dial the host server
req.URL.Host = c.addr
req.URL.Scheme = "http"
if c.tls != nil {
req.URL.Scheme = "https"
}
resp, err := c.HTTPClient().Do(req)
if err != nil {