dmotz / trystero

✨🤝✨ Build instant multiplayer webapps, no server required — Magic WebRTC matchmaking over BitTorrent, Nostr, MQTT, IPFS, Supabase, and Firebase
https://oxism.com/trystero
MIT License
1.33k stars 92 forks source link

RTCPeerConnection is not defined #70

Closed rockey2020 closed 6 months ago

rockey2020 commented 7 months ago

When I use in node.js 21

const config = { appId: "wo_shi_ce_shi_10086" };
  const room = joinRoom(config, "yoyodyne");

  room.onPeerJoin((peerId) => console.log(`${peerId} joined`));
jeremyckahn commented 7 months ago

This is happening because Trystero uses WebRTC, which is not available in NodeJS (see #24).

rockey2020 commented 7 months ago

https://github.com/murat-dogan/node-datachannel

At present, node-datachannel is stable and can be used in production environments. I wonder if there are any plans to replace it with this one?

jeremyckahn commented 7 months ago

https://github.com/murat-dogan/node-datachannel

At present, node-datachannel is stable and can be used in production environments. I wonder if there are any plans to replace it with this one?

That seems like a great idea. I'll play around with using it as a polyfill when I have some time!

dmotz commented 6 months ago

Let's move this discussion over to #24.