News for hackers. Stuff that matters.
Re:Ambient Co-Presence by rgbrgb on Sunday December 31, 2023 @02:51PM (#38826960)
as someone who likes working in a coffeeshop full of sf strivers, i love the vibe of these co-presence ideas. I have a technical question though...

Has anyone figured out a nice way to do the partykit-like cursor stuff [0] that doesn't need a database/intermediary? It would be so nice to be able to ship a p2p presence-enabled static site without a dedicated server. Looks like partykit has a generous free tier but we all know those only last so long.

Oh and while I'm here I'll plug my friend's project that this reminded me of! StreetPass is a browser extension that helps you find your people on Mastodon by checking for social metadata tags on the sites you visit [1].

[0]: https://blog.partykit.io/posts/cursor-party

[1]: https://streetpass.social

Re:Ambient Co-Presence by esafak on Sunday December 31, 2023 @04:40PM (#38827736)
Use Websockets if it's just two people.

edit: This is server-mediated. For true P2P you could use WebRTC.

Re:Ambient Co-Presence by rgbrgb on Sunday December 31, 2023 @05:11PM (#38827964)
how do you get websockets to work p2p? afaik websockets needs a dedicated server to relay messages.
Re:Ambient Co-Presence by jcelerier on Sunday December 31, 2023 @11:41PM (#38829774)
WebRTC will also require having TURN servers to relay messages if you want to be compatible with everyone on internet. True P2P is pretty much impossible in a way that works in 100% of the networks.
Re:Ambient Co-Presence by gfodor on Sunday December 31, 2023 @09:19PM (#38829245)
You can use my project p2pcf [1] to do WebRTC signalling and then sync the cursors by just blasting datachannel messages to all your connected peers. For a project I made that uses this to do far more than cursor syncing, but syncs an entire 3d world with voip, checkout https://webspaces.space

[1] https://github.com/gfodor/p2pcf

Re:Ambient Co-Presence by rgbrgb on Friday January 05, 2024 @02:58PM (#38884000)
awesome, thank you