about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-03-15 00:38:15 +0100
committerLeah Neukirchen <leah@vuxu.org>2020-03-15 00:38:15 +0100
commitdfc2408fee0a9b4b10abdeea99a97633bea6857c (patch)
treee77896229f8c67da3a55463817a4a8eebc237335
parent0c295b5e7a2c7ac43cbcf0bb4e4402425c88ec31 (diff)
downloadhtping-dfc2408fee0a9b4b10abdeea99a97633bea6857c.tar.gz
htping-dfc2408fee0a9b4b10abdeea99a97633bea6857c.tar.xz
htping-dfc2408fee0a9b4b10abdeea99a97633bea6857c.zip
Use default RoundTrip implementation
-rw-r--r--htping.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/htping.go b/htping.go
index f32611d..5e310fe 100644
--- a/htping.go
+++ b/htping.go
@@ -34,7 +34,7 @@ var http11 bool
 var keepalive bool
 
 type transport struct {
-	rtp  http.RoundTripper
+	http.RoundTripper
 	msg  string
 	addr string
 }
@@ -79,7 +79,7 @@ func newTransport() *transport {
 		Timeout:   5 * time.Second,
 	}
 
-	tr.rtp = &http.Transport{
+	tr.RoundTripper = &http.Transport{
 		Proxy:               http.ProxyFromEnvironment,
 		TLSHandshakeTimeout: 5 * time.Second,
 		DisableKeepAlives:   !keepalive,
@@ -101,10 +101,6 @@ func newTransport() *transport {
 	return tr
 }
 
-func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
-	return t.rtp.RoundTrip(req)
-}
-
 func (t *transport) GotConn(info httptrace.GotConnInfo) {
 	t.addr = info.Conn.RemoteAddr().String()
 }