From 6232890bae2aea121173f2aac5ffee88e88e9235 Mon Sep 17 00:00:00 2001 From: Totodore Date: Tue, 19 Sep 2023 16:24:41 +0200 Subject: [PATCH 1/2] feat: add test `should close the connection if no handshake is received` --- Readme.md | 1 + test-suite/test-suite.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Readme.md b/Readme.md index 4c5f6ce..a331dd0 100644 --- a/Readme.md +++ b/Readme.md @@ -704,6 +704,7 @@ const io = new Server(3000, { pingInterval: 300, pingTimeout: 200, maxPayload: 1000000, + connectTimeout: 700, cors: { origin: "*" } diff --git a/test-suite/test-suite.js b/test-suite/test-suite.js index 313b3a2..aaee882 100644 --- a/test-suite/test-suite.js +++ b/test-suite/test-suite.js @@ -507,6 +507,15 @@ describe("Socket.IO protocol", () => { await waitFor(socket, "close"); }); + + + it("should close the connection if no handshake is received", async () => { + const socket = new WebSocket( + `${WS_URL}/socket.io/?EIO=4&transport=websocket` + ); + + await waitFor(socket, "close"); + }); }); describe("disconnect", () => { From ee1ac7ee7a4cd287e0e796c593e7a25e376f9dea Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Tue, 19 Sep 2023 17:14:55 +0200 Subject: [PATCH 2/2] increase connectTimeout --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index a331dd0..348dbd7 100644 --- a/Readme.md +++ b/Readme.md @@ -704,7 +704,7 @@ const io = new Server(3000, { pingInterval: 300, pingTimeout: 200, maxPayload: 1000000, - connectTimeout: 700, + connectTimeout: 1000, cors: { origin: "*" }