@@ -281,7 +281,7 @@ func TestProbeRandom(t *testing.T) {
281
281
require .NoError (t , err , "MakeTestCiphers failed: %v" , err )
282
282
testMetrics := & probeTestMetrics {}
283
283
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
284
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , 200 * time .Millisecond )
284
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , 200 * time .Millisecond )
285
285
done := make (chan struct {})
286
286
go func () {
287
287
StreamServe (WrapStreamListener (listener .AcceptTCP ), handler .Handle )
@@ -358,7 +358,7 @@ func TestProbeClientBytesBasicTruncated(t *testing.T) {
358
358
cipher := firstCipher (cipherList )
359
359
testMetrics := & probeTestMetrics {}
360
360
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
361
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , 200 * time .Millisecond )
361
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , 200 * time .Millisecond )
362
362
handler .SetTargetDialer (makeValidatingTCPStreamDialer (allowAll ))
363
363
done := make (chan struct {})
364
364
go func () {
@@ -393,7 +393,7 @@ func TestProbeClientBytesBasicModified(t *testing.T) {
393
393
cipher := firstCipher (cipherList )
394
394
testMetrics := & probeTestMetrics {}
395
395
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
396
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , 200 * time .Millisecond )
396
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , 200 * time .Millisecond )
397
397
handler .SetTargetDialer (makeValidatingTCPStreamDialer (allowAll ))
398
398
done := make (chan struct {})
399
399
go func () {
@@ -429,7 +429,7 @@ func TestProbeClientBytesCoalescedModified(t *testing.T) {
429
429
cipher := firstCipher (cipherList )
430
430
testMetrics := & probeTestMetrics {}
431
431
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
432
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , 200 * time .Millisecond )
432
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , 200 * time .Millisecond )
433
433
handler .SetTargetDialer (makeValidatingTCPStreamDialer (allowAll ))
434
434
done := make (chan struct {})
435
435
go func () {
@@ -472,7 +472,7 @@ func TestProbeServerBytesModified(t *testing.T) {
472
472
cipher := firstCipher (cipherList )
473
473
testMetrics := & probeTestMetrics {}
474
474
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
475
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , 200 * time .Millisecond )
475
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , 200 * time .Millisecond )
476
476
done := make (chan struct {})
477
477
go func () {
478
478
StreamServe (WrapStreamListener (listener .AcceptTCP ), handler .Handle )
@@ -503,7 +503,7 @@ func TestReplayDefense(t *testing.T) {
503
503
testMetrics := & probeTestMetrics {}
504
504
const testTimeout = 200 * time .Millisecond
505
505
authFunc := NewShadowsocksStreamAuthenticator (cipherList , & replayCache , testMetrics )
506
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , testTimeout )
506
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , testTimeout )
507
507
snapshot := cipherList .SnapshotForClientIP (netip.Addr {})
508
508
cipherEntry := snapshot [0 ].Value .(* CipherEntry )
509
509
cipher := cipherEntry .CryptoKey
@@ -582,7 +582,7 @@ func TestReverseReplayDefense(t *testing.T) {
582
582
testMetrics := & probeTestMetrics {}
583
583
const testTimeout = 200 * time .Millisecond
584
584
authFunc := NewShadowsocksStreamAuthenticator (cipherList , & replayCache , testMetrics )
585
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , testTimeout )
585
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , testTimeout )
586
586
snapshot := cipherList .SnapshotForClientIP (netip.Addr {})
587
587
cipherEntry := snapshot [0 ].Value .(* CipherEntry )
588
588
cipher := cipherEntry .CryptoKey
@@ -653,7 +653,7 @@ func probeExpectTimeout(t *testing.T, payloadSize int) {
653
653
require .NoError (t , err , "MakeTestCiphers failed: %v" , err )
654
654
testMetrics := & probeTestMetrics {}
655
655
authFunc := NewShadowsocksStreamAuthenticator (cipherList , nil , testMetrics )
656
- handler := NewTCPHandler (listener .Addr ().( * net. TCPAddr ). Port , authFunc , testMetrics , testTimeout )
656
+ handler := NewTCPHandler (listener .Addr ().String () , authFunc , testMetrics , testTimeout )
657
657
658
658
done := make (chan struct {})
659
659
go func () {
0 commit comments