pont
is an online game based on
Qwirkle (by Mindware Games)
Notably, both the client and server are written in Rust; the only Javascript is a shim to load the WebAssembly module.
It's easiest to run the whole application on a single VM, using NGINX to both serve static content and to act as a secure proxy for websocket communication. The latter means we don't need SSL support in the game server itself.
The system looks something like this:
I'm hosting a copy of the game at https://pont.mattkeeter.com, using a $5/month droplet from Digital Ocean and Dreamhost for domain registration.
sudo apt update
sudo apt install build-essentials libssl-dev pkg-config
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
sudo apt install nginx
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx
(read and follow certbot
's instructions)
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 8081
sudo ufw enable
git clone https://github.com/mkeeter/pont.git
cd pont/pont-client
wasm-pack build --target web
sudo cp pont.conf /etc/nginx/sites-enabled/pont.conf
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -s reload
This won't work out of the box, because the configuration assumes the url is
pont.mattkeeter.com
, which won't be true for you; edit it accordingly.
cd pont/pont-server
cargo run --release
(leave this in a screen
session for easy persistence!)
© 2020 Matthew Keeter
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.