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.
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 serverful technically speaking. This is neat in that you don't even need to setup anything with a cloud provider yourself to enable p2p connections
I've always seen the distinction as "serverless" meaning there wasn't a set group of servers always on and instead they provision up and down on demand.
Only avoiding provisioning and managing the server just means you are renting rather than self-hosting.
The VPS is like renting office space. You don't own the space, but for the most part get to use it how you want, and all the responsibilities that come with that.
"Serverless" is like paying for a hot desk by the minute, with little control of your surroundings, but it is convenient and cheap if you only need it for an hour.
At one job I had access to some paid AWS support tier. It's basically a bunch of consultants. We needed to process a datastream of events from user actions on a website. We asked about serverless / AWS Lambda. Their answer was something like "Well yeah it'll work but don't do that. It'll cost too much money and you'll wind up rebuilding it around EC2 anyways"
Yup. If you want something to plumb some pretty low volume events, sure serverless like Lambda can be useful. Anything which would be considered high levels of compute, you are just wayyy over paying. Hell, even EC2 on spot instance is expensive compute. I do like some AWS services, but yeah they come at a premium that is just getting more and more expensive.
My mental model is "we handle interpreter restarts for you, so forget about systemd unit files and CEO's laptop with minimized tmux"
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.
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.
We've circled back to dial-up modems :D
serverless nowadays means "no server in YOUR infrastructure"
I didn't know about the QR-Code solution how does it work ?
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.
wait but this should only work on locals / close networks shouldn't it ? i thought you still need some proxying in other cases (hence the turn) - i really need to study this again asap tough
STUN gives back your public IP:port, TURN gives you assigned proxied IP:port.
You take that data and send to the peer over signaling connection, and they call you back on that IP:port. Most NAT implementations make and keep a temporary mapping between public port to private IP consistent[1] for few minutes, and not completely random per destination[2], so it usually works.
1: e.g. router.public.ip.example:23456 <-> 192.168.0.12:12345
2: e.g. if stun.l.google.com:12345 sent from port 23456 but if yourfriend.router.ip.example:12345 sent from port 45678
woaw thank you ; will definitely hop back on this topic now ; very much appreciate the answer
Yes. Unless the party generating the QR code first obtains its external IP address by other means, which would still require some kind of echo server. Even then, ignoring outdated approaches like UPnP, a commonly accessible host would be needed to establish signalling with e.g. NAT hole punching for anything but the most basic of setups.
They say that serverless stacks have the highest server bills.