Open ackava opened 5 months ago
I could indeed reproduce the issue, thanks for raising this.
Another possible workaround is to start the HTTP/2 server with allowHTTP1: true
:
const server = createSecureServer(
{
key: readFileSync("./key.pem"),
cert: readFileSync("./cert.pem"),
allowHTTP1: true,
}
);
const io = new Server(server);
@darrachequesne allowHTTP1
no longer works with chrome version 121 onwards, it used to work till 120.
Describe the bug Creating HTTP/2 server mentioned in the example works well with Firefox because Firefox still uses HTTP/1.1 to connect to web server. However, chrome has implemented
CONNECT
method of HTTP/2, and thus socket.io no longer connects with HTTP/2 server.Chrome 120 still connects Web Socket over HTTP 1.1, but this stops working from 121 onwards.
To Reproduce
Expected behavior It should connect to socket.io server, but it does not.
Platform:
Additional context For HTTP/1.1 , http2Server emits
upgrade
event, which engine.io handles correctly. For HTTP/2, http2Server does not emitupgrade
event if web socket client sendsHTTP-METHOD='CONNECT'
.Work Around/Recommendation