-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Priority: NormalMinor issue impacting one or more usersMinor issue impacting one or more usersType: BugSomething isn't workingSomething isn't working
Description
Describe the bug
Streaming requests with the fetch API doesn't work when using Cloudflare Tunnel.
To Reproduce
Steps to reproduce the behavior:
- Run
./cloudflared tunnel --hello-world --protocol=http2 - Open the quick Tunnel URL
https://xxx.trycloudflare.comin Google Chrome - Run this code in the Console
function wait(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
}
const stream = new ReadableStream({
async start(controller) {
await wait(1000);
controller.enqueue('This ');
await wait(1000);
controller.enqueue('is ');
await wait(1000);
controller.enqueue('a ');
await wait(1000);
controller.enqueue('slow ');
await wait(1000);
controller.enqueue('request.');
controller.close();
},
}).pipeThrough(new TextEncoderStream());
fetch("/", {
method: 'POST',
headers: {'Content-Type': 'text/plain'},
body: stream,
duplex: 'half',
});- Using Wireshark we can see the cloudflared received the whole request in one DATA frame.
HyperText Transfer Protocol 2
Stream: DATA, Stream ID: 63, Length 23
Length: 23
Type: DATA (0)
Flags: 0x01, End Stream
0... .... .... .... .... .... .... .... = Reserved: 0x0
.000 0000 0000 0000 0000 0000 0011 1111 = Stream Identifier: 63
[Pad Length: 0]
Data: 54686973206973206120736c6f7720726571756573742e
Line-based text data: text/plain (1 lines)
This is a slow request.
Expected behavior
cloudflared should receive 5 DATA frames.
Environment and versions
- OS: Linux debian
- Architecture: amd64
- Version: 2024.12.2
P1N2O
Metadata
Metadata
Assignees
Labels
Priority: NormalMinor issue impacting one or more usersMinor issue impacting one or more usersType: BugSomething isn't workingSomething isn't working