-
Notifications
You must be signed in to change notification settings - Fork 570
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
uWebSocket: allow to specify compression option #633
Comments
In addition it will be nice to pass |
That's a great idea! Would you have time to open a pull request? |
@darrachequesne yes, but since this uwebsocket specific option how you want to model it? is it make sense to add uWebSocket configuration under |
@yosiat it should work with an union type: public attach(app /* : TemplatedApp */, options: AttachOptions & { compression?: number } = {}) {
const path = (options.path || "/engine.io").replace(/\/$/, "") + "/";
// ...
} What do you think? |
@darrachequesne sounds good and then we will pass this union here as well - https://github.com/socketio/socket.io/blob/master/lib/index.ts#L353 ? |
Yes 👍 |
You can now pass additional options: ```js const { App } = require("uWebSockets.js"); const { uServer } = require("engine.io"); const app = new App(); const server = new uServer(); server.attach(app, { compression: uWS.DEDICATED_COMPRESSOR_128KB, // defaults to none idleTimeout: 60, // defaults to 120 maxBackpressure: 8 * 1024 // defaults to 1024 * 1024 }); app.listen(3000); ``` Related: #633
This has been implemented in 49bb7cf, and included in |
Hi,
I am so excited about uWebSocket support and I want to roll it out, but I saw uWebSocket have support for multiple compression options - SHARED_COMPRESSOR, DEDICATED, etc.. and I would like to tune it for my application use-case.
https://unetworking.github.io/uWebSockets.js/generated/interfaces/WebSocketBehavior.html#compression
Is is possible to expose from socket.io to pass an option to engine.io to allow configuration compression option here -
https://github.com/socketio/engine.io/blob/master/lib/userver.ts#L50
I can implement it, but not sure what's the best way (to have this as "generic" option and not transport specific)
The text was updated successfully, but these errors were encountered: