by stcredzero · 9y ago · 0 comments
https://secure.emergencevector.com/tutorial/
If you can't figure out how to make it into Hyperspace, you are officially a weakly interacting massive particle! :D
Everything is client-server, client wins, except for one thing. (Left as an exercise.) WebRTC is only there as a substitute for UDP.
I had the polarity reversed. It's actually client-server, server wins.
I knew that this was possible in theory, but my experience with messing around with the available serverside WebRTC libraries gave off a similar first impression to the one you mention in your blog, namely immature libraries.
Looking forward to your blog post on your experiences with Datachannel.
var wrtc = require('electron-webrtc')({ headless: true });
var SimplePeer = require('simple-peer');
var requestify = require('requestify');
var dgram = require('dgram');
The Go server uses UDP to talk to one of the 4 node server processes, which are running instances of Chromium under xvfb under tmux. There's a lot of code load overhead for the 4 processes, in terms of a lot of Chromium loaded but not running, but EC2 servers are RAM heavy, so not an issue.I haven't looked into exploiting the new true headless mode in Chrome yet, which should simplify things a lot. I'm also thinking of doing a full port to Go for WebRTC. That's a lot of stuff, however.