I’m a NodeJS developer and I have some problems listening to the “upgrade” event on my origin web server since the Connection “upgrade” header is not supported by HTTP/2 and HTTP/3 but only by HTTP/1.1
After some research and tests, I noticed that Browser/Client <—> Cloudflare requests are served using HTTP/2 since Cloudflare and the Browser automatically negotiate the highest protocol available.
So even if Cloudflare forwards requests using HTTP/1.1 and my webserver tries to upgrade it, the upgrade will never receive an OK from the Client since there’s a conflict between HTTP versions.
I’d like to know if there’s a way to downgrade or specify the version to use for the Client <—> Cloudflare connection.
I use HTTP, HTTPS,http-proxy, cors, socket.io, and express.
If you need the code comment and I will post it.
P.S.: I might be 100% wrong.
question from:
https://stackoverflow.com/questions/66050781/cloudflare-nodejs-http-connection-upgrade-to-websocket 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…