gun icon indicating copy to clipboard operation
gun copied to clipboard

not working even in same computer between to tab

Open KTBsomen opened this issue 1 year ago • 2 comments

i just used your playground in two tabs in one i removed the set interval.I am expecting to get the realtime updates from another tab. which is not happening. even fireship made a chat app with this which is also not working. fireship is the youtuber whose video is on the docs

KTBsomen avatar May 05 '24 16:05 KTBsomen

which playground?

fresh installs are working, tho there does seem to be some broken relays out there so just watch out and switch to use your own or different relay URL.

amark avatar Jul 23 '24 12:07 amark

@KTBsomen The Fireship app did not work because he use Gun() without default peers, you need to use Gun("https://gun-manhattan.herokuapp.com/gun") and your 2 tabs will sync.

nogringo avatar Aug 19 '24 09:08 nogringo

Faced the same issue & fixed it. Now it works across browsers as well, not just tabs. To be fair the playground is misleading, because you go in with the expectation that it should automatically sync by default. But it doesn't, unless you edit it and specify the peers.

Use the peers as @nogringo suggested. Lookup the docs / quickstart or helloworld and see how the GUN object is constructed and the parameters passed. Pass in those same urls. They are peers & Gun needs peers in common, in order to sync.

DhavalW avatar Oct 09 '24 10:10 DhavalW

can peerjs help as setting up peers is a daunting task

KTBsomen avatar Oct 09 '24 10:10 KTBsomen