From 7730595b48da2f83b42557120b567d9071673401 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 1 Feb 2023 12:57:11 -0500 Subject: [PATCH] *http listen doesnt exist in browser --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index ea9d921..1cbf703 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,8 +68,11 @@ export default class HandshakeProxy extends Proxy { createSocket, }); - this._node.http.http.listen = (port: number, host: string, cb: Function) => - cb(); + if(this?._node?.http?.http?.listen){ + this._node.http.http.listen = (port: number, host: string, cb: Function) => + cb(); + } + await this._node.open(); this._node.pool.connected = true;