why is HTTP/3 traffic faster when wrapped to an SSH tunnel?

86 views Asked by At

I am experimenting with HTTP/3, I compiled both nghttpx and nginx with HTTP/3 support and deployed them to an EC2 instance. I also compiled curl 8.4.0 with HTTP/3 support and use Firefox 118.0.2 as an alternative client. What I noticed is that downloading a 100MB test file with HTTP/2

curl --http2 -o /dev/null -v https://my.domain.name:8443/100mb.test -k

has an average speed of about 5 MB/s with my internet connection. Using HTTP/3 instead

curl --http3 -o /dev/null -v https://my.domain.name:8443/100mb.test -k

runs at around 200 KB/s only. Even more strange, if I create an SSH tunnel to my machine with

ssh -L 8443:localhost:8443 my.domain.name 

and then try an HTTP/3 download through the tunnel

curl --http3 -o /dev/null -v https://localhost:8443/100mb.test -k

speed goes back to 5MB/s. I've tried both nginx and nghttpx as servers and curl and Firefox as clients and the behavior is the same.

What can be the explanation for this behavior?

EDIT: SSH protocol uses TCP, so it's not possible to create a UDP tunnel or to forward UDP traffic, what I had experienced was simply curl failing to connect with TCP3 to the local 8443 and then falling back to HTTP/2

0

There are 0 answers