Skip to content

reqwest::Client::default() doesn't work with reqwest-websocket if ALPN is available #2

Description

@rinsuki

currently we are not supporting WebSockets over HTTP/2, but not restricting HTTP request to HTTP/1.1.

as a result, if user using reqwest with ALPN supported backends (e.g. native-tls-alpn or rustls series), reqwest-websocket will not work with default client.

We should restrict it with .version(reqwest::Version::HTTP_11) (RequestBuilder), but actually this is broken now (ref. seanmonstar/reqwest#2116 )

so I think we can take those workarounds for now:

  • more detailed HandshakeFailed error (probably you also want to check HTTP version?)
  • forced to use HTTP/1.x series by reqwest::Client::builder().http1_only().build() in example codes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions