{"id":25064003,"url":"https://github.com/drwhut/tabletop_club_lobby_server","last_synced_at":"2026-02-10T21:15:58.476Z","repository":{"id":276005190,"uuid":"771418845","full_name":"drwhut/tabletop_club_lobby_server","owner":"drwhut","description":"A WebRTC signalling server for Tabletop Club that allows players to connect peer-to-peer with the use of room codes.","archived":false,"fork":false,"pushed_at":"2025-04-08T16:08:10.000Z","size":471,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T09:57:21.912Z","etag":null,"topics":["game","multiplayer","peer-to-peer","server","tokio-rs","webrtc-signaling","websocket"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drwhut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-13T09:10:46.000Z","updated_at":"2025-04-08T16:08:14.000Z","dependencies_parsed_at":"2025-02-05T19:44:34.787Z","dependency_job_id":"c1acd3a1-f7d0-416e-b8ac-159c16fa39a5","html_url":"https://github.com/drwhut/tabletop_club_lobby_server","commit_stats":null,"previous_names":["drwhut/tabletop_club_lobby_server"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/drwhut/tabletop_club_lobby_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwhut%2Ftabletop_club_lobby_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwhut%2Ftabletop_club_lobby_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwhut%2Ftabletop_club_lobby_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwhut%2Ftabletop_club_lobby_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drwhut","download_url":"https://codeload.github.com/drwhut/tabletop_club_lobby_server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drwhut%2Ftabletop_club_lobby_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29317037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game","multiplayer","peer-to-peer","server","tokio-rs","webrtc-signaling","websocket"],"created_at":"2025-02-06T19:00:35.592Z","updated_at":"2026-02-10T21:15:58.331Z","avatar_url":"https://github.com/drwhut.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tabletop Club Lobby Server\n\nThis repository contains the source code for [Tabletop Club](https://tabletopclub.net/)'s\nlobby server, which is responsible for keeping track of multiplayer lobbies.\n\nIn essence, it is a WebSocket server that listens out for commands from clients\nto either host or join rooms with unique four letter room codes, e.g. `ABCD`.\n\nOnce two clients have joined the same room, it is up to them to send each other\nWebRTC messages (offers, answers, and candidates) so that they can establish\na direct peer-to-peer connection with each other.\n\n## Compiling\n\nTo compile and run the server, you will need to install [Rust](https://www.rust-lang.org/tools/install)\nfor your platform, as well as [OpenSSL](https://docs.rs/openssl/latest/openssl/#automatic).\n\n### Building\n\n```bash\ngit clone https://github.com/drwhut/tabletop_club_lobby_server.git\ncd tabletop_club_lobby_server\ncargo build --release\n```\n\nThe resulting binary will be placed in: `target/release/ttc-lobby`.\n\n### Running\n\n```bash\ncargo run --release\n```\n\n### Testing\n\n```bash\ncargo test\n```\n\n**NOTE:** Occasionally a test might fail with the following error:\n\n```\nerror receiving message from server: Io(Os { code: 104, kind: ConnectionReset, message: \"Connection reset by peer\" })\n```\n\nAs far as I can tell, this is dependent on how the host handles networking.\nIf you know of a way to stop this error and to make the tests 100% consistent,\nplease open an issue or pull request.\n\n**macOS:** The test `connection::tests::accept_tls` is expected to fail due to\nthe test certificate having an expiry date of 10 years.\n\n## Usage\n\nOnce you have the server running locally, how you configure Tabletop Club to\nconnect to your local instance, instead of the official global instance, depends\non which version of Tabletop Club you are using:\n\n### Tabletop Club v0.1.x\n\n1. Run the server with TLS encryption using the test certificate and private key.\n\n   ```bash\n   cargo run -- -p 9080 -t -x tests/certificate.crt -k tests/private.pem\n   ```\n\n2. Run the game by passing the following command line arguments:\n\n   ```bash\n   ./TabletopClub.x86_64 --master-server wss://localhost:9080 --ssl-certificate /full/path/to/certificate.crt\n   ```\n\n3. In the main menu, click \"Multiplayer\", then \"Host Game\". Your local server\n   should create a room, and give your game instance the room code.\n\n**NOTE:** The test certificate and private key provided will only work from\n`localhost`. If you wish to have other players connect to your instance, you\nwill need to generate your own certificate and private key pair\n[using OpenSSL](https://stackoverflow.com/a/10176685).\n\n### Tabletop Club v0.2.x+\n\nTODO\n\n### Configuration\n\nThe server uses a configuration file to set specific values at runtime.\nBy default, the server will create one with the name `server.toml`, but this can\nbe changed using the `-c` argument.\n\nWith it, you can change properties such as the maximum number of rooms, the\nmaximum message size, or the ping interval.\n\n*You do not need to restart the server to change the configuration.*\nInstead, the server will check the configuration file at the same location every\n30 seconds to see if it has been modified. If it has, then it automatically\nupdates the used values on the fly.\n\nFor example, if there are currently 10 rooms open, and you edit the file such\nthat `max_rooms = 5`, in the next 30 seconds the server will close five of the\nrooms to adhere to the new maximum.\n\n### Arguments\n\n* `-c`, `--config`: Set the file path to the configuration file. This file is\n  periodically checked for changes. If the file does not exist, one is\n  automatically created. Default value is `server.toml`.\n\n  ```bash\n  cargo run -- -c my_config.toml\n  ```\n\n* `-p`, `--port`: Set the port number the server uses to listen for connections.\n  Default is `9080`.\n\n  ```bash\n  cargo run -- -p 9550\n  ```\n\n* `-t`, `--tls`: Enables TLS encryption. If used, a certificate and private key\n  must be provided.\n\n  * `-x`, `--x509-certificate`: The file path to the X509 certificate used as\n    the public key for TLS encryption.\n\n  * `-k`, `--private-key`: The file path to the PEM-encoded private key.\n\n  ```bash\n  cargo run -- -t -x certificate.crt -k private.pem\n  ```\n\n## Reverse Proxy\n\nThe server does not provide security measures like rate or connection limiting\nas is. Instead, if you wish to use this server in a production environment, then\nit is *highly* recommended to use a reverse proxy in front of this server.\n\nHere is an example configuration file for forwarding requests to the server\nthrough Nginx:\n\n```nginx\n# Rate-limiting for establishing connections to the lobby server.\nlimit_req_zone $binary_remote_addr zone=lobby:10m rate=12r/m;\n\n# Limit the number of connections from any given source.\nlimit_conn_zone $binary_remote_addr zone=remote:10m;\n\n# Set the \"Connection\" header only if the \"Upgrade\" header is present.\nmap $http_upgrade $connection_upgrade {\n\tdefault\tupgrade;\n\t''\tclose;\n}\n\nserver {\n    listen 443 ssl;\n    listen [::]:443 ssl;\n\n    server_name lobby.mydomain.com;\n\n    ssl_certificate /path/to/certificate.crt;\n    ssl_certificate_key /path/to/private.pem;\n\n    location / {\n        proxy_pass http://localhost:9080;\n        proxy_set_header Host $http_host;\n        proxy_http_version 1.1;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n        proxy_set_header X-Real-IP $remote_addr;\n\n        proxy_set_header Upgrade $http_upgrade;\n        proxy_set_header Connection $connection_upgrade;\n\n        # Only allow a connection from a given remote address once every five\n        # seconds, with up to one extra.\n        limit_req zone=lobby burst=1;\n\n        # Only allow up to five total connections from a given remote address.\n        limit_conn remote 5;\n    }\n}\n```\n\n**NOTE:** If you enable SSL at the reverse proxy stage, there is no need to\nenable TLS on the server itself. That is, you can omit the `-t` argument.\n\n## Metrics\n\nThe ability to monitor metrics, such as the number of open rooms or the number\nof connected clients, will be added at a later date.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwhut%2Ftabletop_club_lobby_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrwhut%2Ftabletop_club_lobby_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrwhut%2Ftabletop_club_lobby_server/lists"}