Skip to content

Commit 0e54a16

Browse files
Added connect-ip (RFC9484) as a known HTTP/3 CONNECT protocol (#273)
Co-authored-by: Ruben2424 <[email protected]>
1 parent 94da82d commit 0e54a16

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

h3/src/ext.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ impl Protocol {
1313
pub const WEB_TRANSPORT: Protocol = Protocol(ProtocolInner::WebTransport);
1414
/// RFC 9298 protocol
1515
pub const CONNECT_UDP: Protocol = Protocol(ProtocolInner::ConnectUdp);
16+
/// RFC 9484 protocol
17+
pub const CONNECT_IP: Protocol = Protocol(ProtocolInner::ConnectIp);
1618

1719
/// Return a &str representation of the `:protocol` pseudo-header value
1820
#[inline]
1921
pub fn as_str(&self) -> &str {
2022
match self.0 {
2123
ProtocolInner::WebTransport => "webtransport",
2224
ProtocolInner::ConnectUdp => "connect-udp",
25+
ProtocolInner::ConnectIp => "connect-ip",
2326
}
2427
}
2528
}
@@ -28,6 +31,7 @@ impl Protocol {
2831
enum ProtocolInner {
2932
WebTransport,
3033
ConnectUdp,
34+
ConnectIp,
3135
}
3236

3337
/// Error when parsing the protocol
@@ -40,6 +44,7 @@ impl FromStr for Protocol {
4044
match s {
4145
"webtransport" => Ok(Self(ProtocolInner::WebTransport)),
4246
"connect-udp" => Ok(Self(ProtocolInner::ConnectUdp)),
47+
"connect-ip" => Ok(Self(ProtocolInner::ConnectIp)),
4348
_ => Err(InvalidProtocol),
4449
}
4550
}

0 commit comments

Comments
 (0)