30 comments

  • kabes 3 hours ago ago

    This isn't serverless. It's just using someone else's servers for the SDP signaling. And in a production app you'd likely also need turn servers and maybe SFU servers.

    There are some true serverless approaches out there for the signaling, e.g. where both peers scan each other's QR code, but that obviously has very limited use.

    • kaoD 2 hours ago ago

      I've always been obsessed with true P2P WebRTC with QR codes but, at least back in the day, Firefox fails the offer under a very short timeout (~5 secs IIRC) which made out of band signaling completely impossible.

      • aketsu 19 minutes ago ago

        I have done this a couple of weeks ago on firefox and it worked fine even with a 1 minute delay. An even easier way to share the SDP offer, at laest when the clients are in physical proximity, is using a data over sound library like ggwave.

    • haxiomic 2 hours ago ago

      You're not wrong! Serverless is a funny term. Cloud companies use serverless to mean you don't have to provision and manage the server yourself, but it is still very much serverfull

    • littlecranky67 an hour ago ago

      serverless nowadays means "no server in YOUR infrastructure"

    • 6r17 an hour ago ago

      I didn't know about the QR-Code solution how does it work ?

      • numpad0 an hour ago ago

        Normally you need a "lobby" server that collects and lists available other clients and pass along connection details. You have no servers in P2P setup, so the "signaling" information has to be shared "out-of-band", like through QR code or super secret invite link or avian IPv4 or something.

    • moffkalast an hour ago ago

      They say that serverless stacks have the highest server bills.

  • Reubend 3 hours ago ago

    WOW this is cool! I love this, but as a nitpick, how scalable is it to do each connection peer to peer? Doesn't that mean that I have to keep a stream connection open for everyone who I want to include in the room?

    • bhaney 3 hours ago ago

      > how scalable is it

      Considering the site just spams my error console with

        DOMException: Failed to construct 'RTCPeerConnection': Cannot create so many PeerConnections
      
      I'd say not very.
    • kabes 3 hours ago ago

      It's not very scalable. Regular rules of webrtc apply, so once you go to a certain number of users, you would have to use an SFU approach.

  • kamranjon 4 hours ago ago

    Awesome way to demonstrate exactly what your library does - also the library itself is a great concept - was just looking for something just like this the other day.

  • sotspecatcle 3 hours ago ago

    Cool, not working in Safari for me though.

    • quietfox an hour ago ago

      It worked for me in Safari for a while, but then the entire browser stopped working.

  • philipallstar 3 hours ago ago

    I remember cloning the twilio code for video conferencing for webrtc and it working instantly. Very cool.

    • dudefeliciano 2 hours ago ago

      On the other hand setting up the turn servers and so on for signaling before the webrtc connection is established can be a nightmare, if not using a third party service like twilio

  • jehnnysmith 17 minutes ago ago

    HN should add downvote option.

  • jsomedon 4 hours ago ago

    This is so fun. You know what, you should change the picture of cursor from hand to something like, bee, or even fly, that should make it even more hilarious :-p

  • Razengan 2 hours ago ago

    It'd be cool if you could easily publish multiplayers games to itch.io or similar websites from Godot or Unity and have automatic matchmaking: the first player to visit the game pages gets matched automatically with the next, and so on.

    Is there anything like that?

    • tasuki 20 minutes ago ago

      I've been looking for this too!

      I'd love to use an existing protocol to get (distributed?) user accounts and chat and stuff, and just build my game as a plugin for that. Or something.

  • florians 3 hours ago ago

    Sweet API design!

  • jojohack 3 hours ago ago

    Love it

  • dsign 3 hours ago ago

    Just a reminder that this kind of user-to-user interaction feature makes your website a "social network" according to UK regulation (and Mississippi's, and more jurisdictions coming soon), and therefore you must get copies of government ID of your users so that you can deny them access if they are underage, and rattle them to the police if you suspect they are committing thought crime by sending certain fruits. Obey the law.

    • andai 3 hours ago ago

      I made a little multiplayer arcade game last year. I added a chat feature with TTS. About an hour after launch it was just the n word over and over again. (Also zalgo text, which somehow strained the browser more than a video game!)

      I removed the chat feature.

      At any rate, getting banned by OFCOM is starting to sound like a badge of honor these days.

    • drawfloat an hour ago ago

      This is factually untrue and either venting or wilfully ignorant of the actual law.

    • ronsor 2 hours ago ago

      Do those laws even apply to P2P apps without central servers?

      • shakna 2 hours ago ago

        Yes. Its defined without a technical requirement - just legal ones.

        Each host will carry a legal responsibility for both what they push, and what they pull.

      • drawfloat an hour ago ago

        They do, but unlike what the OP claims, you do not need to age verify your site just because you added a social element. If the purpose is not to distribute pornography/other age restricted materials and you are able to moderate the site (ie: are not facebook scale), this is not required.

        The law sucks but the misinformation around it is getting out of hand.

  • evbogue 4 hours ago ago

    I use Trystero as one of the transfer methods on wiredove. it's super cool. it doesn't always work because punching thru NAT is a pain, but when it does work it's awesome. Trystero is also cool if you want to hook up a webcam or a video meeting with the minimal amount of code.