Luigi Pinca
Luigi Pinca
@fungiboletus I can't reproduce on Ubuntu 18.04 using your example and Node.js 13.1.0: server.js ```js 'use strict'; const WebSocket = require('ws'); const message = Buffer.alloc(256); const wss = new WebSocket.Server({...
`fast-zlib` is bit hacky but that is not a problem, we can propose an API to use inflate/deflate streams synchronously in Node.js core. The problem as I see it is...
It's an option but it complicates everything :(. The user can already compress the message synchronously before sending it in a WebSocket message. It's not the same but close enough....
> 99% of all WS apps always send messages smaller than 1KB, so this rule is essentially disabling compression altogether. What is this based on? Probably true for stock trading...
I've seen and worked on WS apps used to transfer huge files, used to stream audio/video data, etc. Those apps used messages way bigger than 1 KB (64 KB /...
@mk-pmb to stay on topic, from my experience compressing very small messages (regardless of how compression is done, sync or async) does not make an app faster but slower. If...
@fungiboletus I was not able to reproduce the memory fragmentation issue using your code above, see https://github.com/websockets/ws/issues/1369#issuecomment-553831310. Also it should be better now as https://github.com/nodejs/node/pull/34048 mitigated the original [issue](https://github.com/nodejs/node/issues/8871).
`verifyClient` is a technical debt imho and the only reason why `WebSocketServer.prototype.handleUpgrade()` is async. I would like to remove it completely. Instead of using it, use something like this ```js...
Anyway, adding custom data to the `request` object as suggested in some comments above, is ok. It's an established pattern in Express and Koa, for example, to pass data between...
@bfailing it is `undefined` because it is an example. `getDataAsync` is an example function to get some data you may need.