提交 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 (
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"regexp"
"strings"
"time"
"github.com/github/hub/utils"
)
......@@ -122,7 +124,14 @@ func newHttpClient(testHost string, verbose bool) *http.Client {
testURL, _ = url.Parse(testHost)
}
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,
OverrideURL: testURL,
Out: os.Stderr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册