mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 14:20:01 -04:00
serverside client chunking impl (CURSED)
This commit is contained in:
parent
a839d0fe51
commit
b73a561844
5 changed files with 51 additions and 20 deletions
|
@ -1,4 +1,3 @@
|
|||
import { ReadableStream } from "node:stream/web";
|
||||
import {
|
||||
C2SRequestType,
|
||||
C2SRequestTypes,
|
||||
|
@ -164,11 +163,11 @@ export class Connection {
|
|||
await this.send(seq, C2SRequestTypes.HTTPRequestStart, new Blob([json]));
|
||||
|
||||
if (body) {
|
||||
for await (const chunk of body) {
|
||||
for await (const chunk of body as unknown as NodeJS.ReadableStream) {
|
||||
await this.send(
|
||||
seq,
|
||||
C2SRequestTypes.HTTPRequestChunk,
|
||||
new Uint8Array(chunk)
|
||||
new Uint8Array(chunk as Uint8Array | ArrayBuffer)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue