提交 722bf938 编写于 作者: J Jingwen Owen Ou

Init transport by following DefaultTransport

See http://golang.org/src/pkg/net/http/transport.go?#L33
上级 1d47d6ed
...@@ -5,11 +5,13 @@ import ( ...@@ -5,11 +5,13 @@ import (
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"net"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
"regexp" "regexp"
"strings" "strings"
"time"
"github.com/github/hub/utils" "github.com/github/hub/utils"
) )
...@@ -122,7 +124,14 @@ func newHttpClient(testHost string, verbose bool) *http.Client { ...@@ -122,7 +124,14 @@ func newHttpClient(testHost string, verbose bool) *http.Client {
testURL, _ = url.Parse(testHost) testURL, _ = url.Parse(testHost)
} }
tr := &verboseTransport{ tr := &verboseTransport{
Transport: &http.Transport{Proxy: proxyFromEnvironment}, Transport: &http.Transport{
Proxy: proxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
},
Verbose: verbose, Verbose: verbose,
OverrideURL: testURL, OverrideURL: testURL,
Out: os.Stderr, Out: os.Stderr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册