diff --git a/common_test.go b/common_test.go index 1665fb6..ebcf478 100644 --- a/common_test.go +++ b/common_test.go @@ -14,9 +14,9 @@ import ( func init() { // SetLogger(&LogLogger{}) // Debug = true - DialTimeout = 500 * time.Millisecond - HandshakeTimeout = 500 * time.Millisecond - ConnectTimeout = 500 * time.Millisecond + DialTimeout = 1000 * time.Millisecond + HandshakeTimeout = 1000 * time.Millisecond + ConnectTimeout = 1000 * time.Millisecond cert, err := GenCertificate() if err != nil { diff --git a/http_test.go b/http_test.go index 461d21c..a257b93 100644 --- a/http_test.go +++ b/http_test.go @@ -12,6 +12,7 @@ import ( "net/http/httptest" "net/url" "testing" + "time" ) // proxyConn obtains a connection to the proxy server. @@ -76,14 +77,14 @@ func proxyRoundtrip(client *Client, server *Server, targetURL string, data []byt return } - // conn.SetDeadline(time.Now().Add(500 * time.Millisecond)) - // defer conn.SetDeadline(time.Time{}) - conn, err = client.Connect(conn, u.Host) if err != nil { return } + conn.SetDeadline(time.Now().Add(500 * time.Millisecond)) + defer conn.SetDeadline(time.Time{}) + return httpRoundtrip(conn, targetURL, data) }