News for hackers. Stuff that matters.
Re:Show HN: I built a website to share files and messages wi... by Vinnl on Sunday May 05, 2024 @05:13AM (#40263334)
A bit off-topic, but since I was looking at doing a side project with a P2P feature, would appreciate if I could pick your brain for a bit: don't you still need to run the STUN and TURN servers? Can you run those using Vercel's serverless functions?
Re:Show HN: I built a website to share files and messages wi... by vmfunction on Sunday May 05, 2024 @05:26AM (#40263386)
look at https://peerjs.com that this the project is using.
Re:Show HN: I built a website to share files and messages wi... by BrandoElFollito on Sunday May 05, 2024 @05:31AM (#40263405)
This looks like an implementation of STUN - there are no miracles, if two machines are behind NATs someone need to broker the connection.
Re:Show HN: I built a website to share files and messages wi... by Vinnl on Sunday May 05, 2024 @06:43AM (#40263788)
Hmm thanks, so that says:

> To broker connections, PeerJS connects to a PeerServer. Note that no peer-to-peer data goes through the server; The server acts only as a connection broker.

> If you don't want to run your own PeerServer, we offer a free cloud-hosted version of PeerServer.

So I suppose there's still a server, but it's shared and run by two folks based on donations: https://peerjs.com/peerserver

Re:Show HN: I built a website to share files and messages wi... by cl3misch on Sunday May 05, 2024 @08:11AM (#40264253)
Without data going through the server it should be pretty cheap to host, right?
Re:Show HN: I built a website to share files and messages wi... by dkraj on Sunday May 05, 2024 @08:36AM (#40264391)
That is why there are public STUN servers available by google that any one can use: stun.l.google.com:19302 stun1.l.google.com:19302 stun2.l.google.com:19302 stun3.l.google.com:19302 stun4.l.google.com:19302
Re:Show HN: I built a website to share files and messages wi... by llmblockchain on Sunday May 05, 2024 @01:42PM (#40266654)
I used peerjs years ago (2013~). It was a whole lot of pain back then... I assume things have gotten better, but damn was it painful! I ended up forking and fixing/maintaining my own fork because it was too slow to get things fixed in master.
Re:Show HN: I built a website to share files and messages wi... by dkraj on Sunday May 05, 2024 @08:34AM (#40264381)
A STUN server is required for discoverability and if still ICE candidates are not found or a negotiation can not take place, I just shows an error for now. About vercel I am not sure need to check whether it provides or not