From ac4aaceb73f434a5b832c597973c9cba1c4cc1cd Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 12 Jul 2023 02:50:44 -0400 Subject: [PATCH] fix: add 1 second timeout to auto-reject and close the connection --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 0827468..5ec85c1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,5 +68,10 @@ export default async ( client.end(); resolve({ host: json.host, port: json.port }); }); + + setTimeout(() => { + client.end(); + reject(); + }, 1000); }); };