5 ms·
Show HN: P2p IRC-inspired browser chat on WebTorrent
- maeln 8y agoDoesn't seem to work on Firefox 61.0.2 on Mac OS. I can send message on Chromium but the chatroom seem empty. EDIT: Work on Chromium :)
- tomxor 8y agohttps://github.com/chr15m/dirc/ https://github.com/chr15m/dirc/
- yazr 8y agoHow do u implement the list of rooms ? Presumably, when a new room is created, this has to be broadcast to all users. Also, i guess every chat line is kind of broadcast to everyone in the room. So how do announce a new line is available? Many thanks.
- chr15m 8y agoWhen you join a room the room name is hashed and you join a WebTorrent swarm based on that hash. So it's a collection of WebRTC peers who are connected to eachother based upon the shared hash of the room name. Not every peer is connected to every other peer. So "when a new room is created, this has to be broadcast to all users" is not quite right. A new swarm is created when a user joins a room-hash for the first time and anybody who joins that same room-hash will be introduced to the same swarm. People who have not joined the room-hash will not be part of the p2p swarm. Currently the hash-based WebRTC signalling that WebTorrent does to introduce peers is quite centralized but the actual communication channels are decentralized. The communication layer is implemented as a WebTorrent "extension protocol" extension. This is the same model dreamtime: https://github.com/chr15m/dreamtime https://github.com/chr15m/dreamtime You are correct that every chat line is broadcast to everyone in the same swarm. In fact, every message is re-broadcast multiple times redundantly by every peer who receives it for the first time, because the WebRTC swarm can be fragmented. Not every peer can directly see every other peer so we must re-broadcast everything to make sure everyone sees each line. So basically for each room you have a set of peers (browsers) connected together loosely with WebRTC data links and messages between them are sent multiple times redundantly. Thank you very much for your interest and for trying it out.
- tribesman 8y agoI never found any p2p app with similar user experience as WhatsApp. All people on this site brag of p2p and their technical prowness, yet no one has managed to build a killer p2p chat app. Disgusting! Probably, they are still debating what programing language to use.
- askz 8y agoThe challenge is yours, then!
- tribesman 8y agoYea, but I've no skills to make one. I am willing to pay for one, £1 per month.
- nickik 8y agoMaybe because WhatsApp has billions to make sure everything works? Even the non-p2p open source apps are less polished. So really it has nothing to do with p2p at all.
- boramalper 8y agoHave you tried Matrix? https://matrix.org/ https://matrix.org/
- chr15m 8y agoMatrix is a great project! I believe it uses a federated model which means that it relies on people donating their servers and bandwidth and messages pass through those federated servers rather than directly between peers as with WebRTC.
- veli_joza 8y agoI find WhatsApp user experience lacking and I wouldn't use it if my friends and contacts weren't all there. It's decent platform for simple sentences and trading emojis/memes I guess.
- chr15m 8y ago
- m-p-3 8y agoWaiting for other participants... On Firefox 61.0.2 Firefox can’t establish a connection to the server at wss://tracker.fastcast.nz/. app.js:15:233483 ICE failed, add a TURN server and see about:webrtc for more details
- chr15m 8y agoThe WebRTC signalling can take a long time (I've seen up to 2 minutes) because your browser has to find a way that other browsers can tunnel in to your network. Once you're connected messages seem to go through fairly quickly. The fastcast.nz error is because that signalling server is down and has been for a while but you can safely ignore it. The "ICE failed" error might be because you are behind a very restrictive firewall. Thanks for trying it out!
- deleted 8y ago[deleted]
- thatcat 8y agoI like it! You might consider reformatting the description to be more like /nick handle // sets handle because it's kind of confusing with the = for those that don't use irc much.
- chr15m 8y agoThanks for testing & for your feedback! I'll have a think about how to make that clearer.