Skip to content

Commit

Permalink
Merge pull request #386 from HollowMan6/max_frame
Browse files Browse the repository at this point in the history
tungstenite connect_with_config use max frame size and max message size
  • Loading branch information
mdrokz committed Mar 29, 2023
2 parents 284754b + b132295 commit fa40745
Showing 1 changed file with 11 additions and 1 deletion.
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

0 comments on commit fa40745

Please sign in to comment.