SS2022 proxy: Refinements & fixes (#7488)

https://github.com/XTLS/Xray-core/pull/7194#issuecomment-6250856095

Closes https://github.com/XTLS/Xray-core/issues/7486

---------

Co-authored-by: Roman Rublev <roman171107@gmail.com>
This commit is contained in:
风扇滑翔翼
2026-11-26 21:09:53 +00:00
committed by GitHub
co-authored by Roman Rublev
parent 67756b3674
commit db6664bd68
10 changed files with 381 additions and 271 deletions
+4 -3
View File
@@ -191,7 +191,7 @@ func TestRelayUDPSessionStabilityAndDispatch(t *testing.T) {
// Verify downstream destination can decode both packets
method, err := GetCipherMethod(MethodAES128GCM)
common.Must(err)
destCodec, err := NewUDPServerCodec(method, destKey, 300*time.Second)
destCodec, err := NewUDPServerCodec(method, destKey, nil, 300*time.Second)
common.Must(err)
mu.Lock()
@@ -202,7 +202,8 @@ func TestRelayUDPSessionStabilityAndDispatch(t *testing.T) {
t.Fatalf("expected 2 received packets at destination, got %d", len(pkts))
}
dec1, err := destCodec.DecodePacket(pkts[0])
dec1, dec2 := DecodedUDPPacket{}, DecodedUDPPacket{}
_, dec1, err = destCodec.DecodePacket(pkts[0])
if err != nil {
t.Fatalf("dest failed to decode packet 1: %v", err)
}
@@ -210,7 +211,7 @@ func TestRelayUDPSessionStabilityAndDispatch(t *testing.T) {
t.Fatalf("dec1 mismatch: sess=%x, pktID=%d, payload=%s", dec1.SessionID, dec1.PacketID, string(dec1.Payload))
}
dec2, err := destCodec.DecodePacket(pkts[1])
_, dec2, err = destCodec.DecodePacket(pkts[1])
if err != nil {
t.Fatalf("dest failed to decode packet 2: %v", err)
}