You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add standalone mode for UDP finalmask/header-custom
allow sending a detached UDP handshake datagram before the actual payload
keep existing per-packet UDP header-custom behavior unchanged unless mode: "standalone" is set
Why
Current UDP header-custom works as a per-packet header wrapper. That is enough for packet shaping, but not for cases where the handshake should be sent as a separate datagram before the real payload.
This PR adds that detached standalone handshake mode only for UDP header-custom. It does not change TCP behavior and does not add protocol-specific helpers.
Scope
add mode: "standalone" for UDP header-custom
send and consume detached standalone handshake datagrams before payload
preserve capture/reuse/metadata behavior in standalone mode
keep existing UDP header-custom behavior unchanged by default
Non-Goals
no new protocol-specific masks
no changes to TCP header-custom
no general programmable transport layer in this PR
Test Plan
go test ./common/serial -run 'TestTypedMessageRoundTripPreservesFinalmaskCustomUDPMode' -count=1
go test ./transport/internet/finalmask -run 'Test(UDPcustomStandaloneClientSendsDetachedHandshakeBeforePayload|UDPcustomStandaloneServerConsumesHandshakeAndAutoResponds|UDPcustomStandaloneStunLikeExchangeUsesSavedTxidAndSrcMetadata|UDPcustomStandaloneClientHandshakeSurvivesConcurrentReader|PacketConnReadWrite|UDPcustomStaticHeaderWireShape|UDPcustomServerRejectsMismatchedStaticHeader|TCPcustomStaticHandshakeRoundTrip|TCPcustomClientRejectsMismatchedServerSequence|ConnReadWrite)' -count=1
local live smoke via SOCKS5 UDP ASSOCIATE against standalone mode returned udp-pr3-standalone-newpr
This PR is not merging the old UDP noise into header-custom.
It only adds a standalone handshake mode for UDP header-custom: send one detached handshake datagram first, then send the real payload.
The old freedom noise did not have handshake semantics like capture/reuse, runtime metadata, or request/response correlation, so I do not think they are the same kind of change.
This PR only extends UDP header-custom with standalone detached handshake behavior. It touches the shared finalmask UDP wiring, but it does not modify or replace the existing noise feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
standalonemode for UDPfinalmask/header-customheader-custombehavior unchanged unlessmode: "standalone"is setWhy
Current UDP
header-customworks as a per-packet header wrapper. That is enough for packet shaping, but not for cases where the handshake should be sent as a separate datagram before the real payload.This PR adds that detached standalone handshake mode only for UDP
header-custom. It does not change TCP behavior and does not add protocol-specific helpers.Scope
mode: "standalone"for UDPheader-customheader-custombehavior unchanged by defaultNon-Goals
header-customTest Plan
go test ./common/serial -run 'TestTypedMessageRoundTripPreservesFinalmaskCustomUDPMode' -count=1go test ./transport/internet/finalmask -run 'Test(UDPcustomStandaloneClientSendsDetachedHandshakeBeforePayload|UDPcustomStandaloneServerConsumesHandshakeAndAutoResponds|UDPcustomStandaloneStunLikeExchangeUsesSavedTxidAndSrcMetadata|UDPcustomStandaloneClientHandshakeSurvivesConcurrentReader|PacketConnReadWrite|UDPcustomStaticHeaderWireShape|UDPcustomServerRejectsMismatchedStaticHeader|TCPcustomStaticHandshakeRoundTrip|TCPcustomClientRejectsMismatchedServerSequence|ConnReadWrite)' -count=1udp-pr3-standalone-newpr