From 06fe425b5ad922e18662e580c2dd9df025158769 Mon Sep 17 00:00:00 2001 From: Cooper Oh Date: Fri, 19 Jul 2024 00:43:19 +0900 Subject: [PATCH] Remove duplicated test --- client_server_test.go | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/client_server_test.go b/client_server_test.go index 2dbd7e6..149db2b 100644 --- a/client_server_test.go +++ b/client_server_test.go @@ -209,43 +209,6 @@ func sendRecv(t *testing.T, ws *Conn) { } func TestProxyDial(t *testing.T) { - s := newServer(t) - defer s.Close() - - surl, _ := url.Parse(s.Server.URL) - - cstDialer := cstDialer // make local copy for modification on next line. - cstDialer.Proxy = http.ProxyURL(surl) - - connect := false - origHandler := s.Server.Config.Handler - - // Capture the request Host header. - s.Server.Config.Handler = http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.Method == http.MethodConnect { - connect = true - w.WriteHeader(http.StatusOK) - return - } - - if !connect { - t.Log("connect not received") - http.Error(w, "connect not received", http.StatusMethodNotAllowed) - return - } - origHandler.ServeHTTP(w, r) - }) - - ws, _, err := cstDialer.Dial(s.URL, nil) - if err != nil { - t.Fatalf("Dial: %v", err) - } - defer ws.Close() - sendRecv(t, ws) -} - -func TestProxyDialer(t *testing.T) { testcases := []struct { name string isTLS bool