Show HN: P2PCF – Low cost, low effort WebRTC signalling using Cloudflare workers
github.com
github.com
Signalling for me has always been handled on a cheap box in some specific AWS regions. The tricky thing was that there was always more latency than I'd like in the initial establishment of the connection. Reducing that latency always played second fiddle to other issues. CF workers is an elegant solution as all signalling would be handled at the edge.
I'm looking forward to taking this for a spin!
I wonder then if the project better suits deno's free idle websockets and broadcast_channel.
Edit: Deno looks interesting - the requirement here is basically similar pricing to Cloudflare, but also needs strongly consistent or low latency eventually consistent k-v storage. I originally tried prototyping this with Workers KV (since you can use it without even putting in a credit card) but the latencies were too high and it caused too many problems. Does Deno have storage?
Edit2: Oh, of course, the websockets would invalidate the need for storage. Maybe this would be a better option! The main q is how likely websockets will remain free. Cloudflare's pricing for websockets isn't that encouraging.
meanwhile CF is asking $200 for 10,000 barely active ws connections and deno is suggesting ws costs are not worth mentioning or measuring for now... Something's gotta give.
> 100,000's of concurrent lite upd 'websockets'
This obviously is not true, much less for $2. :) You can have "100,000s" of "connections" using HTTP/2 today, including with WebSockets, thanks to transport streams. But this number doesn't mean anything by itself; you often don't ridiculous ratios of streams:clients like 1000:1 or whatever, it's often much smaller, so the per-connection overhead matters a lot in practice e.g. if your ratio is 3:1, then the initial handshake and state tracking matter significantly when considering total overhead. Your QUIC framework still has to do connection tracking, congestion control, encryption, stream muxing, etc. It's not magically a billion times less "expensive" than TCP for magical reasons, but it does avoid some of TCP's long-tail pitfalls in terms of latency and mobile use. WebTransport also avoids some of the design constraints of WebSockets (unreliable transport!), which helps, and in some cases is a significant performance boost for end to end performance between the client & server. But it's not going to magically make running WebTransport services 100x faster, or easier vs the competition or whatever.
The reality is that "100,000s concurrent instances" of anything is complex to support either yourself or at scale from providers. I wouldn't bet money on WebTransport being easier for these providers to offer than WebSockets will. If anything, it is currently, and will remain MORE difficult to support right now; due to the fact QUIC stacks haven't had decades of optimization stuffed into them, high-scale QUIC deployments tend do a lot worse in terms of CPU cycles and utilization. That will change, but not now. And they might still support it despite this! Because WebTransport is really useful technology, don't get me wrong. (This is even before you get into the ever-fierce debate about UDP, about whether people will end up blocking it and requiring HTTP/2 fallbacks, etc...)
I will give your solution a try to see if it can solve my problem - at last! Thank you so much for this
If communication is mostly 1-1 you could directly connect peers without needing to send video / audio to a 3rd party.
That said, if your users can trust you’ve deployed this worker and that the worker doesn’t hijack the SDP, the e2e would be legit beyond that bit of trust. TURN doesn’t see the clear RTP payloads nor does the signalling server.
Durable Objects + Websockets are way, way more expensive. (At least, that’s how it looked.)