From 5fd7f2591ba981a9c50647b5be2467d1b6bef095 Mon Sep 17 00:00:00 2001 From: onyinyang Date: Thu, 30 Jan 2025 10:06:32 -0500 Subject: [PATCH] Remove deprecated roundtripper function --- utls/roundtripper.go | 9 ++------- utls/roundtripper_test.go | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/utls/roundtripper.go b/utls/roundtripper.go index 10c9155..63e297c 100644 --- a/utls/roundtripper.go +++ b/utls/roundtripper.go @@ -5,23 +5,18 @@ import ( "crypto/tls" "errors" "fmt" - "golang.org/x/net/proxy" "net" "net/http" "net/url" "sync" "time" + "golang.org/x/net/proxy" + utls "github.com/refraction-networking/utls" "golang.org/x/net/http2" ) -// Deprecated: use NewUTLSHTTPRoundTripperWithProxy instead -func NewUTLSHTTPRoundTripper(clientHelloID utls.ClientHelloID, uTlsConfig *utls.Config, - backdropTransport http.RoundTripper, removeSNI bool) http.RoundTripper { - return NewUTLSHTTPRoundTripperWithProxy(clientHelloID, uTlsConfig, backdropTransport, removeSNI, nil) -} - // NewUTLSHTTPRoundTripperWithProxy creates an instance of RoundTripper that dial to remote HTTPS endpoint with // an alternative version of TLS implementation that attempts to imitate browsers' fingerprint. // clientHelloID is the clientHello that uTLS attempts to imitate diff --git a/utls/roundtripper_test.go b/utls/roundtripper_test.go index 905b78e..719fb07 100644 --- a/utls/roundtripper_test.go +++ b/utls/roundtripper_test.go @@ -153,9 +153,9 @@ func runRoundTripperTest(t *testing.T, h2listen, h1listen, h2addr, h1addr string }, } { t.Run("Testing fingerprint for "+v.name, func(t *testing.T) { - rtter := NewUTLSHTTPRoundTripper(v.id, &utls.Config{ + rtter := NewUTLSHTTPRoundTripperWithProxy(v.id, &utls.Config{ InsecureSkipVerify: true, - }, http.DefaultTransport, false) + }, http.DefaultTransport, false, nil) for count := 0; count <= 10; count++ { Convey("HTTP 1.1 Test", t, func(c C) { -- GitLab