Skip to main content

peek_draft

Function peek_draft 

Source
fn peek_draft(buf: &[u8], side: ProxySide) -> DraftPeek
Expand description

Try to name the concrete draft by peeking at the first SETUP message on a control stream.

  • On the ClientToProxy direction, looks at CLIENT_SETUP’s supported_versions list and returns the highest draft in the 07–14 range we support.
  • On the RelayToProxy direction, looks at SERVER_SETUP’s selected_version and returns the matching draft.
  • For draft-15+ the SETUP carries no version, but those cases don’t reach this function because the caller only invokes it when the draft isn’t already fixed by ALPN.