add connection padding on server side

This commit is contained in:
Shelikhoo 2025-01-29 11:46:33 +00:00
parent 53172a588b
commit 0aa1470e01
No known key found for this signature in database
GPG key ID: 4C9764E9FE80A3DC
3 changed files with 24 additions and 4 deletions

View file

@ -28,6 +28,7 @@ package snowflake_client
import (
"context"
"errors"
"gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/common/packetpadding"
"log"
"math/rand"
"net"
@ -342,7 +343,11 @@ func newSession(snowflakes SnowflakeCollector) (net.PacketConn, *smux.Session, e
}
log.Println("---- Handler: snowflake assigned ----")
packetConnWrapper := newPacketConnWrapper(dummyAddr{}, dummyAddr{}, ConfirmsReadWriteCloserPreservesMessageBoundary(conn))
packetConnWrapper := newPacketConnWrapper(dummyAddr{}, dummyAddr{},
packetpadding.NewPaddableConnection(
ConfirmsReadWriteCloserPreservesMessageBoundary(conn),
packetpadding.New()))
return packetConnWrapper, nil
}
pconn := turbotunnel.NewRedialPacketConn(dummyAddr{}, dummyAddr{}, dialContext)