From e8a44315a8026b094b66125db079253422526581 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 17 Feb 2023 16:32:39 -0500 Subject: [PATCH] *Need to hook to the stream directly --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ebbd6dc..c57624b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -193,7 +193,7 @@ export default class HyperswarmWeb extends EventEmitter { keyPair: this._options.keyPair, }); - this._activeRelay.on("close", () => { + this._activeRelay.dht._protocol._stream.once("close", () => { this._activeRelay = undefined; this._ready = false; });