masque_udp_bind_server_session (masque v0.7.0)
View SourcePer-tunnel server session for Connect-UDP-Bind (draft-ietf-masque-connect-udp-listen-11). Sibling of masque_server_session / masque_h2_server_session; one module serves both h2 and h3 by dispatching on a transport field, the same shape used by masque_ip_server_session.
Responsibilities:
- Run the handler's
init/2and splice the resulting{response_headers, _}action into the 2xx response so the proxy emitsConnect-UDP-Bind: ?1andProxy-Public-Address. - Own the per-session compression tables (own + peer, via
masque_compression_table). - Drain capsules off the request stream and dispatch
COMPRESSION_ASSIGN/ACK/CLOSEto the table; pass any other capsule to the handler'shandle_capsule/3. - Decode incoming HTTP datagrams: extract context-id, look up the compression-table entry, decode the inner Bound UDP Proxying Payload via
masque_udp_bind_payload, and callmasque_udp_bind_proxy_handler:handle_bind_packet/3. - Apply handler actions (
{send_bind_packet, Peer, Bytes},{compression_assign, _},{compression_ack, _},{compression_close, _}, plus the legacysend_capsule/close_session).
Deliberately minimal in this first PR:
- Wait-for-ACK on send is implemented via the table's
statefield; an outbound mapping ispending_ackuntilCOMPRESSION_ACKarrives. The session emits compressed payloads only againstinstalledentries; otherwise it falls through to the uncompressed channel if open, or drops the packet. - The
max_pending_compression_responsesbound and the post-close prohibition are deferred to a follow-up PR; the hooks are in place but the policy is permissive.