Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ impl Client {
/// headers: typing.Optional[typing.Dict[str, bytes]]
/// cookies: typing.Optional[typing.Dict[str, str]]
/// protocols: typing.Optional[builtins.list[builtins.str]]
/// use_http2: typing.Optional[builtins.bool]
/// auth: typing.Optional[builtins.str]
/// bearer_auth: typing.Optional[builtins.str]
/// basic_auth: typing.Optional[tuple[builtins.str, typing.Optional[builtins.str]]]
Expand Down
9 changes: 9 additions & 0 deletions src/async_impl/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ where
accept_unmasked_frames
);

// Use http2 options.
apply_option!(
apply_option_or_default,
builder,
params.use_http2,
use_http2,
false
);

// Network options.
apply_option!(
apply_transformed_option_ref,
Expand Down
1 change: 1 addition & 0 deletions src/blocking/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ impl BlockingClient {
/// headers: typing.Optional[typing.Dict[str, bytes]]
/// cookies: typing.Optional[typing.Dict[str, str]]
/// protocols: typing.Optional[builtins.list[builtins.str]]
/// use_http2: typing.Optional[builtins.bool]
/// auth: typing.Optional[builtins.str]
/// bearer_auth: typing.Optional[builtins.str]
/// basic_auth: typing.Optional[tuple[builtins.str, typing.Optional[builtins.str]]]
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ fn request(
/// headers: typing.Optional[typing.Dict[str, bytes]]
/// cookies: typing.Optional[typing.Dict[str, str]]
/// protocols: typing.Optional[builtins.list[builtins.str]]
/// use_http2: typing.Optional[builtins.bool]
/// auth: typing.Optional[builtins.str]
/// bearer_auth: typing.Optional[builtins.str]
/// basic_auth: typing.Optional[tuple[builtins.str, typing.Optional[builtins.str]]]
Expand Down
4 changes: 4 additions & 0 deletions src/param/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub struct WebSocketParams {
/// The protocols to use for the request.
pub protocols: Option<Vec<String>>,

/// Whether to use HTTP/2 for the websocket.
pub use_http2: Option<bool>,

/// The authentication to use for the request.
pub auth: Option<PyBackedStr>,

Expand Down Expand Up @@ -91,6 +94,7 @@ impl<'py> FromPyObject<'py> for WebSocketParams {
extract_option!(ob, params, local_address);
extract_option!(ob, params, interface);

extract_option!(ob, params, use_http2);
extract_option!(ob, params, headers);
extract_option!(ob, params, cookies);
extract_option!(ob, params, protocols);
Expand Down