Closed 0x7d8 closed 1 year ago
im not using an external framework, do you want me to describe some variables so you know more?
but im not really here for help with that code anyway, I want some example for backpressure without knowing the size in advance
You can't dump application code and expect someone to solve your app problems. Whether you send a video (VideoStreamer.js) or compressed content, is irrelevant to uWS. It's a layer atop that's not related to anything the server does.
If you get VideoStreamer.js working, you can get any other content working.
@0x7d8 You are incorrectly getting res.getWriteOffset()
after attempting write on data chunk, you are suppose to get that before write to get initial offset like VideoStreamer.js example, your code will send extra repeat chunks of data
But res.getWriteOffset()
only works with res.tryEnd()
, you can't use tryEnd because you don't know length. res.write()
buffers the whole chunk for you, just wait for onWritable
again if res.write()
returns false to resume stream, no need to slice chunks
Can anyone provide an example for zlib compression with uws? Ive tried a lot but every time I pause a stream and resume it later (backpressure handling, works 100% fine without compression) it just flips some letters, sometimes just letting out information.