masque_h1_server (masque v0.7.0)
View SourceMASQUE CONNECT-UDP listener over HTTP/1.1.
Wraps h1:start_server/3 with a request handler that validates the RFC 9298 Upgrade envelope (GET + Upgrade: connect-udp + Capsule-Protocol: ?1), matches the path against the configured URI template, and spawns a per-tunnel masque_h1_server_session on acceptance. The session itself calls h1:accept_upgrade/3 so socket ownership lands on the session gen_server.
No per-connection tunnel accounting: h1 Upgrade inherently tops out at one tunnel per TCP/TLS connection (the state machine shuts down and hands off the socket on 101).
Handles CONNECT-UDP, CONNECT-IP, and classic CONNECT-TCP (the RFC 9110 §9.3.6 tunnel). The first two use HTTP Upgrade + RFC 9297 capsules; CONNECT-TCP uses the classic CONNECT host:port HTTP/1.1 method and becomes a raw byte pipe after the 200 response.
Summary
Types
Functions
-spec start_listener(listener_name(), listener_opts()) -> {ok, h1:server_ref()} | {error, term()}.
-spec stop_listener(h1:server_ref() | listener_name()) -> ok | {error, term()}.