Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tungstenite connect_with_config use max frame size and max message size #386

Merged
merged 1 commit into from Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/browser/transport/web_socket_connection.rs
Expand Up @@ -6,6 +6,7 @@ use std::sync::Mutex;
use anyhow::Result;
use log::{debug, info, trace, warn};
use tungstenite::http::Response;
use tungstenite::protocol::WebSocketConfig;
use tungstenite::stream::MaybeTlsStream;
use url::Url;

Expand Down Expand Up @@ -131,7 +132,16 @@ impl WebSocketConnection {
tungstenite::WebSocket<MaybeTlsStream<TcpStream>>,
Response<Option<Vec<u8>>>,
)> {
let mut client = tungstenite::connect(ws_url)?;
let mut client = tungstenite::client::connect_with_config(
ws_url,
Some(WebSocketConfig {
max_send_queue: None,
max_message_size: None,
max_frame_size: None,
accept_unmasked_frames: true,
}),
u8::MAX - 1,
)?;

let stream = client.0.get_mut();

Expand Down