geckos.io
geckos.io copied to clipboard
Allow the client to be used in a nodejs instance
https://github.com/geckosio/geckos.io/blob/0101a7a70a2fae8603ca1c8ea599d3214ab9e0d8/packages/client/src/wrtc/peerConnection.ts#L4
Perhaps, if window does not exist import RTCPeerConnection
from node-webrtc?
Even I would like the same to be implemented because . @yandeu any thoughts on this?
It should be easy to add this in v2.
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Don't close it, github actions bot. I'm interested in this feature.
also interested in this.
I too need a solution for this
Yes, please. I also need a solution.
I managed to use the client in NodeJS by providing some global variables from wrtc
and node-fetch
packages.
// Polyfills
import wrtc from "wrtc";
import fetch from "node-fetch";
global.RTCPeerConnection = wrtc.RTCPeerConnection;
global.RTCSessionDescription = wrtc.RTCSessionDescription;
// @ts-ignore
global.fetch = fetch;
// Client can now be used
import geckos from "@geckos.io/client";
I no longer need this. But @gutnar's solution should likely be PR'ed.
Installing two additional packages that will only be used by a small fraction of people seems like a waste to me. Someone should just make a wrapper module for geckos, so those that need this functionality can install that instead.
I think, you are confused as to how the node bundle works. If you are using this for web browser I believe this doesn't make a difference
It would add two extra (rather large) dependencies to the package.
It would add two extra (rather large) dependencies to the package.
Which a tree shake algorithm, which most bundlers implement, would filter out.
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.