Open
Description
Hey team!
I've been using ring-undertow-adapter and it's been great! One feature we needed recently, is to enable permessage-deflate
for websockets. To do this, we patched ring.adapter.undertow/ws-request
like so:
(defn ws-request [^HttpServerExchange exchange ^IPersistentMap headers ^WebSocketConnectionCallback callback]
(let [handler (-> (WebSocketProtocolHandshakeHandler. callback)
(.addExtension (PerMessageDeflateHandshake. true 6)))]
(when headers
(set-headers (.getResponseHeaders exchange) headers))
(.handleRequest handler exchange)))
This resulted in quite a nice perf bump for slow connections.
Would you be interested in upstreaming some option for permessage-deflate? Happy to pop in a PR. Maybe we can include this as an option in the :undertow/websocket
map.
Metadata
Assignees
Labels
No labels
Activity