geckos.io icon indicating copy to clipboard operation
geckos.io copied to clipboard

Allow the client to be used in a nodejs instance

Open TroyKomodo opened this issue 3 years ago • 13 comments

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?

TroyKomodo avatar Dec 24 '20 04:12 TroyKomodo

Even I would like the same to be implemented because . @yandeu any thoughts on this?

bil-ash avatar Mar 30 '21 12:03 bil-ash

It should be easy to add this in v2.

yandeu avatar Mar 30 '21 22:03 yandeu

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.

github-actions[bot] avatar Jan 27 '22 05:01 github-actions[bot]

Don't close it, github actions bot. I'm interested in this feature.

jaburns avatar Jan 28 '22 05:01 jaburns

also interested in this.

KingCosmic avatar Feb 01 '22 22:02 KingCosmic

I too need a solution for this

Jalcantara88 avatar Feb 01 '22 22:02 Jalcantara88

Yes, please. I also need a solution.

ChrisDiPiero avatar Feb 01 '22 22:02 ChrisDiPiero

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";

gutnar avatar Feb 03 '22 07:02 gutnar

I no longer need this. But @gutnar's solution should likely be PR'ed.

TroyKomodo avatar Feb 03 '22 07:02 TroyKomodo

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.

Codezilluh avatar Feb 06 '22 14:02 Codezilluh

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

TroyKomodo avatar Feb 06 '22 16:02 TroyKomodo

It would add two extra (rather large) dependencies to the package.

Codezilluh avatar Feb 06 '22 17:02 Codezilluh

It would add two extra (rather large) dependencies to the package.

Which a tree shake algorithm, which most bundlers implement, would filter out.

emansom avatar Sep 02 '22 22:09 emansom

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.

github-actions[bot] avatar Jun 30 '23 05:06 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Jul 10 '23 05:07 github-actions[bot]