mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
ws: upgrade tungstenite
This commit is contained in:
parent
1667339ee5
commit
c2f7b6ed92
6 changed files with 13 additions and 10 deletions
|
|
@ -28,7 +28,7 @@ aquatic_toml_config.workspace = true
|
|||
aquatic_ws_protocol.workspace = true
|
||||
|
||||
anyhow = "1"
|
||||
async-tungstenite = "0.22"
|
||||
async-tungstenite = "0.23"
|
||||
cfg-if = "1"
|
||||
futures = "0.3"
|
||||
futures-lite = "1"
|
||||
|
|
@ -49,7 +49,7 @@ serde = { version = "1", features = ["derive"] }
|
|||
signal-hook = { version = "0.3" }
|
||||
slab = "0.4"
|
||||
socket2 = { version = "0.5", features = ["all"] }
|
||||
tungstenite = "0.19"
|
||||
tungstenite = "0.20"
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "1"
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ pub struct NetworkConfig {
|
|||
|
||||
pub websocket_max_message_size: usize,
|
||||
pub websocket_max_frame_size: usize,
|
||||
pub websocket_write_buffer_size: usize,
|
||||
|
||||
/// Return a HTTP 200 Ok response when receiving GET /health. Can not be
|
||||
/// combined with enable_tls.
|
||||
|
|
@ -95,6 +96,7 @@ impl Default for NetworkConfig {
|
|||
|
||||
websocket_max_message_size: 64 * 1024,
|
||||
websocket_max_frame_size: 16 * 1024,
|
||||
websocket_write_buffer_size: 8 * 1024,
|
||||
|
||||
enable_http_health_checks: false,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -464,7 +464,8 @@ async fn run_stream_agnostic_connection<
|
|||
let ws_config = tungstenite::protocol::WebSocketConfig {
|
||||
max_frame_size: Some(config.network.websocket_max_frame_size),
|
||||
max_message_size: Some(config.network.websocket_max_message_size),
|
||||
max_send_queue: Some(2),
|
||||
write_buffer_size: config.network.websocket_write_buffer_size,
|
||||
max_write_buffer_size: config.network.websocket_write_buffer_size * 3,
|
||||
..Default::default()
|
||||
};
|
||||
let stream = async_tungstenite::accept_async_with_config(stream, Some(ws_config)).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue