Skip to content

Commit 89fce50

Browse files
committed
Compress messages
1 parent a1b26b0 commit 89fce50

3 files changed

Lines changed: 47 additions & 57 deletions

File tree

Cargo.lock

Lines changed: 44 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ url = "2.2.2"
2323

2424
tokio = { version = "1.6.1", features = ["fs", "process", "macros", "rt", "rt-multi-thread"] }
2525
tokio-util = { version = "0.6.7", features = ["codec"] }
26-
warp = { version = "0.3.1", default-features = false, features = ["websocket"] }
26+
warp = { git = "https://github.com/kazk/warp", branch = "permessage-deflate", default-features = false, features = ["websocket"] }
2727

2828
tracing = "0.1.26"
2929
tracing-subscriber = "0.2.18"

src/api/proxy.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ pub fn handler(ctx: Context) -> impl Filter<Extract = impl Reply, Error = Reject
4444
.and(with_context(ctx))
4545
.and(with_optional_query())
4646
.map(|ws: warp::ws::Ws, ctx, query| {
47-
ws.on_upgrade(move |socket| on_upgrade(socket, ctx, query))
47+
ws.with_compression()
48+
.on_upgrade(move |socket| on_upgrade(socket, ctx, query))
4849
})
4950
}
5051

0 commit comments

Comments
 (0)