Pitaya is an open-source, MIT-licensed game server framework written in Go that provides clustering support and client libraries for iOS, Android, Unity and other platforms through a shared C SDK, aimed at teams building distributed multiplayer games and other server-side applications.
What it is
Pitaya is a lightweight game server framework implemented in Go, licensed under MIT and developed originally by TFG Co. It describes itself as a basic development framework for distributed multiplayer games and server-side applications, and its architecture separates client-facing connector servers from backend room servers: the repository's cluster_grpc example runs one connector frontend and one room backend as two cooperating Pitaya processes, with clients sending requests into the cluster through a REPL client. Client-side reach is provided outside the core Go repository, through libpitaya and its C SDK, with libpitaya-cluster covering clustered clients.
The concrete problem it addresses is the connective tissue of a multiplayer backend: maintaining client sessions, routing requests between frontend and backend processes, discovering other servers in the cluster, and exchanging remote calls. Pitaya delegates service discovery to etcd and remote procedure calls to NATS, both listed as optional prerequisites, so a team does not have to build that coordination layer itself. It lives in the Go ecosystem — the name is tagged as a golang-application, and the prerequisites begin with Go 1.16 or newer — and it stands in for hand-written session and cluster plumbing. The README also places it in an existing lineage: Pitaya is based on nano, and takes its distributed design and protocol inspiration from pomelo.
Key capabilities
- Clustered server topologies built from distinct frontend and backend roles, demonstrated by the cluster_grpc example with
make run-cluster-grpc-example-connector and make run-cluster-grpc-example-room.
- Service discovery through etcd and RPC through NATS, both configurable as prerequisites alongside a plain Go toolchain.
- Client libraries for iOS, Android, Unity and other platforms through the libpitaya C SDK, with libpitaya-cluster available for clustered clients.
- A
pitaya-cli REPL client for interactive testing, supporting commands such as connect localhost:3250 and request room.room.entry.
- Support for the protobuf protocol in cluster mode, shown by the cluster_protobuf example.
- A documented WebSocket example that implements a chat room in roughly 100 lines.
- Companion projects in the same organisation, including pitaya-admin, pitaya-bot and pitaya-protos, plus API reference documentation on GoDoc and in-depth documentation on Read the Docs.
Who uses it and how
- Teams building distributed multiplayer games that need to separate connection handling from game logic across a frontend connector and backend room servers.
- Studios targeting several client platforms at once — iOS, Android and Unity are named — that want a single server-side protocol reached through the C SDK.
- Developers running the stack locally, starting etcd (and optionally NATS) in containers with
docker compose up -d etcd, or without Docker if preferred.
- Engineers who want to exercise a running cluster interactively through
pitaya-cli rather than writing a client first.
- Projects that need adjacent tooling for administration, bot-driven traffic and shared protocol definitions, supplied by the sibling repositories.
Getting started
Clone the repository with git clone https://github.com/topfreegames/pitaya.git and run make setup to install dependencies; running the framework means starting etcd through Docker Compose and then launching the example servers with the provided make targets. Tests are run with make test, which covers both unit and e2e suites.
How it compares
No list of commercial products is given for Pitaya, so its nearest reference points are the projects its own README names. It is built on nano and borrows its distributed design and protocol from pomelo, which makes it the Go member of that lineage rather than a departure from it.
When to use it — and when not to
A self-hoster must provide a Go 1.16 or newer toolchain and, for clustering, operate etcd for service discovery and NATS for RPC, whether in containers or directly. Teams that are not working in Go, or that do not need clustering and multi-platform client SDKs, are likely to find the framework heavier than their needs. The repository also has rough edges worth knowing about: the contributing section is still a placeholder marked #TODO, so the process for submitting changes is not documented, and the project is best evaluated through its examples and documentation before being adopted.
project readme (upstream, from github) — read inline
pitaya

Pitaya is an simple, fast and lightweight game server framework with clustering support and client libraries for iOS, Android, Unity and others through the C SDK.
It provides a basic development framework for distributed multiplayer games and server-side applications.
Getting Started
Prerequisites
- Go >= 1.16
- etcd (optional, used for service discovery)
- nats (optional, used for sending and receiving rpc)
- docker (optional, used for running etcd and nats dependencies on containers)
Installing
clone the repo
git clone https://github.com/topfreegames/pitaya.git
setup pitaya dependencies
make setup
Hacking pitaya
Here's one example of running Pitaya:
Start etcd (This command requires docker-compose and will run an etcd container locally. An etcd may be run without docker if preferred.)
cd ./examples/testing && docker compose up -d etcd
run the connector frontend server from cluster_grpc example
make run-cluster-grpc-example-connector
run the room backend server from the cluster_grpc example
make run-cluster-grpc-example-room
Now there should be 2 pitaya servers running, a frontend connector and a backend room. To send requests, use a REPL client for pitaya pitaya-cli.
$ pitaya-cli
Pitaya REPL Client
>>> connect localhost:3250
connected!
>>> request room.room.entry
>>> sv-> {"code":0,"result":"ok"}
Running the tests
make test
This command will run both unit and e2e tests.
Contributing
#TODO
Authors
License
MIT License
Acknowledgements
- nano authors for building the framework pitaya is based on.
- pomelo authors for the inspiration on the distributed design and protocol
Security
If you have found a security vulnerability, please email [email protected]
Resources