MithUniverse's monster-truck races with friends are WebRTC multiplayer with no game server. Each player's browser sends its truck straight to the others over WebRTC, the technology behind video calls in the browser. The site's only job is to introduce the browsers to each other; when a network blocks a direct connection, Cloudflare's relay carries the race instead.
How do you start a race with friends?
Open mith.tech/race and make a lobby. You get a six-character code (like K7Q-4ZP) and a link to share. Friends join, say they're ready, and the host starts the session. Up to 12 race and 20 more can watch; the computer can fill the empty places on the grid.
What does the site do in a race?
Two browsers can't find each other on their own. Before they can talk, each has to learn the other's network addresses and agree on how to encrypt the connection; WebRTC calls this signalling. MithUniverse keeps it as small as it can be:
- The host asks the site for a code. The site keeps it in memory, not a database.
- A friend's browser sends its connection offer with that code.
- The host's browser, which is waiting on a held-open request, picks the offer up and sends back its answer.
- The browsers connect directly. The site forgets the code 10 minutes after it was last used.
That is about four small requests per player. After that, nothing about the race touches the site.
Host network or mesh network: which should you pick?
Once connected, the trucks have to reach everyone, and every WebRTC multiplayer game has to decide how its players connect. Here the host picks in the lobby.
Host network (a star). Every browser keeps one connection, to the host's. Each racer sends its own truck to the host; the host drives the computer's trucks and sends everyone's positions back out. It's simple and holds up for the biggest groups, because each guest has only one connection to look after.
Mesh network. The racers also connect to each other. The host passes their connection offers along over the links it already has, so the site isn't involved again. A friend's truck then arrives straight from their browser: one hop instead of two, which means less lag. The number of links grows quickly with the group, so it suits up to about six racers. If two friends can't link directly, the host simply keeps passing that truck on, and leaves out of each snapshot the trucks a racer already gets directly.
| Host network | Mesh network | |
|---|---|---|
| Connections per racer | One, to the host | One to the host, one to each other racer |
| A friend's truck reaches you | Via the host (two hops) | Straight from their browser (one hop) |
| Best for | Big groups, slower connections | Up to about six racers who want the least lag |
| If a direct link fails | Not applicable | The host passes that truck on |
Either way, the other trucks are drawn a tenth of a second behind what was last heard, so their movement stays smooth between packets.
What happens when a network blocks direct connections?
Direct connections work on most home broadband and when everyone shares one Wi-Fi. They often fail on mobile data, where the carrier puts many phones behind one shared address, and on office and college networks that block them on purpose. Without help, those players simply can't join.
This is the classic WebRTC multiplayer problem, and a TURN relay is the fix: a server both browsers can reach, which forwards their packets. MithUniverse uses Cloudflare's TURN service. Each time someone opens a lobby, the site asks Cloudflare for short-lived credentials and hands them to the browser alongside the usual address-finding server. The browser tries the direct paths first and uses the relay only if they all fail. The traffic stays encrypted end to end, and the lobby marks anyone coming through the relay so the host can see why their ping is higher.
How does everyone start at the same moment?
In a race, being a second late to the lights matters. When the host starts the session:
- Every browser builds the same grid from the same random seed: the same names, the same order, the same layout.
- Each one puts its truck on the grid and tells the host it's there.
- Once all of them have, the host sends "go". Each browser starts its lights allowing for half its measured round trip to the host, so they go out together.
- Anyone not on the grid within 20 seconds watches this race, a computer driver takes their truck, and they race the next one.
Why is every lap a sale?
Each lap takes one order from enquiry to paid. The checkpoints are its steps: enquiry in, quote sent, order confirmed, dispatched, invoiced. The finish line is the payment landing against its invoice. It's how we explain what a connected ERP does: a sales order becomes the delivery note, then the invoice, then the payment entry, each one already filled in. You can see an order go from start to finish in the live demo.
Frequently asked questions
+Do the other players see my IP address?
They can. A direct connection between browsers means each side learns the other's network address, just as on a video call. When the relay is used, the other side sees Cloudflare's address instead. The lobby says this before you make or join one.
+Does any race data go through mith.tech?
No. The site passes the connection offers and answers when someone joins, and hands out relay credentials. The trucks' positions travel only between the players' browsers, or through Cloudflare's relay when a direct connection isn't possible.
+Which should I pick, host or mesh?
Mesh for a handful of friends who want the least lag; host for bigger groups or slower connections. You can switch in the lobby before you start.
+What happens if the host leaves?
The race ends with the order as it stood, and everyone regroups automatically under a new code, with the next player in the lobby becoming the host.
Manoj
Comments & ratings
No comments yet. Start a new discussion.
Worked with us? Leave a Google review