forked from quic-go/quic-go
proxy: remove QuicProxy.LocalPort method (#4920)
This commit is contained in:
@@ -870,7 +870,8 @@ func TestHTTP0RTT(t *testing.T) {
|
||||
}
|
||||
defer tr.Close()
|
||||
|
||||
req, err := http.NewRequest(http3.MethodGet0RTT, fmt.Sprintf("https://localhost:%d/0rtt", proxy.LocalPort()), nil)
|
||||
proxyPort := proxy.LocalAddr().(*net.UDPAddr).Port
|
||||
req, err := http.NewRequest(http3.MethodGet0RTT, fmt.Sprintf("https://localhost:%d/0rtt", proxyPort), nil)
|
||||
require.NoError(t, err)
|
||||
rsp, err := tr.RoundTrip(req)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -215,12 +215,7 @@ func runMITMTest(t *testing.T, serverTr, clientTr *quic.Transport, rtt time.Dura
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), scaleDuration(time.Second))
|
||||
defer cancel()
|
||||
conn, err := clientTr.Dial(
|
||||
ctx,
|
||||
&net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: proxy.LocalPort()},
|
||||
getTLSClientConfig(),
|
||||
getQuicConfig(nil),
|
||||
)
|
||||
conn, err := clientTr.Dial(ctx, proxy.LocalAddr(), getTLSClientConfig(), getQuicConfig(nil))
|
||||
require.NoError(t, err)
|
||||
defer conn.CloseWithError(0, "")
|
||||
|
||||
@@ -428,12 +423,7 @@ func runMITMTestSuccessful(t *testing.T, serverTransport, clientTransport *quic.
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), scaleDuration(50*time.Millisecond))
|
||||
defer cancel()
|
||||
_, err = clientTransport.Dial(
|
||||
ctx,
|
||||
&net.UDPAddr{IP: net.IPv4(127, 0, 0, 1), Port: proxy.LocalPort()},
|
||||
getTLSClientConfig(),
|
||||
getQuicConfig(nil),
|
||||
)
|
||||
_, err = clientTransport.Dial(ctx, proxy.LocalAddr(), getTLSClientConfig(), getQuicConfig(nil))
|
||||
require.Error(t, err)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user