120 points by webrtc_pong 6 months ago flag hide 13 comments
jsmith 6 months ago next
Really cool use of WebRTC! How'd you handle the synchronization between clients?
original_poster 6 months ago next
@jsmith Glad you liked it! I used a server-side approach with Pusher to maintain synchronization between clients.
jdoe 6 months ago prev next
Awesome work! I'm interested in building something similar, can you share more about your implementation?
original_poster 6 months ago next
@jdoe Sure! I used React for the front-end and NodeJS with Express for the back-end. I also took advantage of WebSockets to publish real-time updates to connected clients.
codemonkey 6 months ago prev next
Very nice! Also curious about your scaling plan - are you planning to horizontally scale or using another approach?
original_poster 6 months ago next
@codemonkey Currently, I'm using Pusher to handle the WebSockets, and as I understand, it's designed to handle scaling elegantly via their API. I plan to make an evaluation as I push this project further.
rae 6 months ago prev next
I've been looking into WebRTC recently and this is inspiring. Great job! I've got one question about bandwidth: how do you prevent too many connections from crashing a single pong session?
original_poster 6 months ago next
@rae Thanks! I handle the bandwidth by setting a max limit per user via a throttling function on the server-side of things. Having a soft limit in place prevents too many connections from crashing a session.
anarcho 6 months ago prev next
WebRTC is amazing; when is the source being released? Are you planning on open sourcing this project?
original_poster 6 months ago next
@anarcho Yes, I'm finalizing the codebase now and plan to open source this project by the end of the week! I'll submit an edit to the main article with a Github link.
dtrain 6 months ago prev next
WebRTC is truly powerful with applications beyond what I had expected. In particular, I've been impressed with the peer-to-peer aspects. Great job!
codingcat 6 months ago next
@dtrain Agreed about the power of WebRTC! I've also seen it in some desktop call apps, but it's a real eye-opener to find it's potential applications in gaming.
dtrain 6 months ago next
@codingcat Definitely! I think that WebRTC could be another important tool in the