BO'S Amusement · 2020 – 2026
HTML5 casino games and game servers
Four HTML5 games for the belgafun.com online casino, the game servers and APIs behind them, and a WebSocket relay that keeps every result on the server.
- Role
- Games, game APIs and WebSocket relay
- Stack
- 4 games: Random Dice, Jokerz, Acite, Card Stacker
- All outcomes calculated on the server
- WebSocket relay that carries the player’s session
belgafun.com was the online casino run by the BO’S Amusement group. The main platform (accounts, wallet, bonuses, back-office) was built by the company’s founder. I built the games and everything the games need: the HTML5 games themselves, the game servers and their APIs, and the real-time connection between them.
The games
Four casino-style games written in JavaScript with Phaser. They run in any modern browser, on desktop and on phones, with separate landscape and portrait layouts.




Every game has a pay table, multipliers for several winning boxes, and mystery bonus rounds. In play-money mode a game can run on its own in the browser. In real-money mode the browser only displays what the server decides.
The game servers and APIs
The game server is written in PHP with a MySQL database. The games call a small set of operations:
- GetBalance starts or resumes a session and loads the player’s state
- Update plays a step of the game on the server and returns the result
- RefreshToken keeps the session alive
- Close settles the round and ends the session
The backend keeps the full game state (cards or dice, stake, bonus progress) server-side, so a dropped connection or a closed tab never loses a round. The game resumes exactly where it stopped, the same idea as power-loss recovery on the kiosks. Money moves between the game server and the casino platform through the platform’s SOAP interface.
The WebSocket relay
Instead of sending an HTTP request for every move, the games keep one WebSocket connection open. I wrote the relay in PHP with Ratchet:
- Each message carries the operation, the game token, the game data and the player’s session cookie.
- The relay forwards the call to the game backend with that cookie attached. The backend sees the real player session and applies the same checks as any web request, so the relay needs no game logic of its own.
- When a socket closes, because the player left or the network dropped, the relay tells the backend to close the session cleanly.
Players get a fast, two-way connection, and the security model stays simple: one backend, one set of rules.
Live demo
A playable version of the games is coming soon, with play money only: no registration and no payments.