elixir-mint / mint

Functional HTTP client for Elixir with support for HTTP/1 and HTTP/2 🌱
Apache License 2.0
1.36k stars 112 forks source link

support SETTINGS_ENABLE_CONNECT_PROTOCOL server-side setting #321

Closed the-mikedavis closed 3 years ago

the-mikedavis commented 3 years ago

Hello! :wave:

I'm a huge fan of Mint, thank y'all for maintaining it :slightly_smiling_face:

I've been eyeing #106 lately and I've been able to get HTTP/1 websockets going with just some minor hacks in NFIBrokerage/mint_web_socket. The HTTP/2 bootstrap extends rfc7540's SETTINGS parameters, though, so it looks like we'll need to some changes here to support HTTP/2.

Specifically rfc8441 adds a settings param SETTINGS_ENABLE_CONNECT_PROTOCOL with a new code of 0x8 defaulting to 0.

This PR adds a new t:Mint.HTTP2.setting/0 :enable_connect_protocol defaulting to false and the encoding and decoding clauses in Mint.HTTP2.Frame.