geckos.io
geckos.io copied to clipboard
Instantiating a geckos client within a web worker throws a ReferenceError
I am trying to init geckos client connection in a web worker, but it throws ReferenceError: RTCPeerConnection is not defined. Does not happen when running on the main thread. Is this a limitation of WebRTC or a Geckos bug?
I want to run my socket connections in a web worker, as my main thread is doing a lot of heavy lifting and I don't want it to impact data stream performance
Had a similar idea but unfortunately: https://stackoverflow.com/a/54209625
According to the specifications [1, 2], navigator.mediaDevices and RTCPeerConnection are not defined for web workers, so WebRTC shouldn't be available on web workers for now.
Maybe Transferable Streams could work?