I'm currently doing something like this, but I instead want to iterate over chunks of data, in the same chunks they were sent to the server:
async function consumeRequest(request: Request) {
if (request.body) {
const reader = readerFromStreamReader(request.body.getReader());
for await (const line of readLines(reader)) {
channelSend.postMessage(line);
}
}
return new Response("Goodbye");
}