Thanks to @kyranet and @vladfrangu for help on this one. guiding me in the right direction. Much appreciated.
instead of returning the promise in connect resolve this.ws to the promise then handle .on's outside the promise, aka only handle actual connection in promise.
Thanks to @kyranet and @vladfrangu for help on this one. guiding me in the right direction. Much appreciated.