{"id":13607979,"url":"https://github.com/giongto35/cloud-morph","last_synced_at":"2025-10-11T02:17:45.642Z","repository":{"id":37367658,"uuid":"287094253","full_name":"giongto35/cloud-morph","owner":"giongto35","description":"Decentralize, Self-host Cloud Gaming/Application","archived":false,"fork":false,"pushed_at":"2022-08-17T11:25:12.000Z","size":79143,"stargazers_count":1105,"open_issues_count":13,"forks_count":113,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-04-03T12:09:08.002Z","etag":null,"topics":["cloud-gaming","cloud-service","cloudgaming","decentralized","diablo","ffmpeg","game","geforcenow","golang","hacktoberfest","hacktoberfest2021","headless-server","pion","stadia","starcraft2","video","webrtc","wine","wine-application","xvfb"],"latest_commit_sha":null,"homepage":"","language":"Go","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/giongto35.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-12T19:04:06.000Z","updated_at":"2025-04-03T00:28:46.000Z","dependencies_parsed_at":"2022-08-03T04:15:59.964Z","dependency_job_id":null,"html_url":"https://github.com/giongto35/cloud-morph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giongto35%2Fcloud-morph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giongto35%2Fcloud-morph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giongto35%2Fcloud-morph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giongto35%2Fcloud-morph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giongto35","download_url":"https://codeload.github.com/giongto35/cloud-morph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565015,"owners_count":21125414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cloud-gaming","cloud-service","cloudgaming","decentralized","diablo","ffmpeg","game","geforcenow","golang","hacktoberfest","hacktoberfest2021","headless-server","pion","stadia","starcraft2","video","webrtc","wine","wine-application","xvfb"],"created_at":"2024-08-01T19:01:23.308Z","updated_at":"2025-10-11T02:17:40.594Z","avatar_url":"https://github.com/giongto35.png","language":"Go","funding_links":[],"categories":["Media API","Go"],"sub_categories":[],"readme":"**Decentralized, Self-hosted Cloud Gaming service on WebBrowser.**  \n**Video Demo**: https://youtu.be/eFR7fLy9z6E  \n**Technical Document**: https://github.com/giongto35/cloud-morph/wiki  \n**Landing Page**: https://cloudmorph.io  \n**CloudRetro**: [https://github.com/giongto35/cloud-game](https://github.com/giongto35/cloud-game): Sister project, Cloud Gaming Service For Retro Games  \n\n## Introduction\n\nCloudMorph is a decentralized, self-hosted cloud gaming/cloud application platform. Users can quickly spawn up a cloud gaming service with minimal configuration. By leveraging the ease of deployment, CloudMorph goal is to build a decentralized cloud application network with app providers and consumers.  \nCloudMorph copes with different technical challenges from OS to Cloud, such as Low-Latency Streaming, Video/Audio encoding pipeline and optimization, Windows application Virtualization in headless server, OS event simulation, NAT traversal, P2P network structurization, etc.  \nUnlike [CloudRetro](https://github.com/giongto35/cloud-game), a completed Cloud Gaming solution for Retro Game run on its dedicated cloud infrastructure, CloudMorph decentralized hosting works to users with any Windows Games/Applications by a generic and modularized solution.\n\n**Discord**: [Join Us](https://discord.gg/ux2rDqwu2W)\n\n## Changelog\n- 26/9/2021: Able to run in Windows/ Mac\n- 19/6/2021: Modularize Frontend as Widget. All parts are independent\n\n## Demo\n\nVideo Demo: https://www.youtube.com/watch?v=fkOpOQ-HwFY\n\n|                       Screenshot                       |                     Screenshot                         |\n| :----------------------------------------------------: | :----------------------------------------------------: |\n| ![screenshot](docs/img/diablo.gif) [Diablo II-US](http://us.clouddiablo.com/) | ![screenshot](docs/img/starcraft.gif) [Starcraft](http://cloudstarcraft.com/) |\n| ![screenshot](docs/img/roadrash.gif) [RoadRash](https://www.youtube.com/watch?v=A2JcFaVlOO4) | ![screenshot](docs/img/changegame.gif) Browse and Switch games |\n\n#### CloudMorph Demo\n- [Cloud Diablo SG](http://clouddiablo.com/) (Demo of Collaborative play Diablo running on Singapore server using CloudMorph).\n- [Cloud Diablo US](http://us.clouddiablo.com/) (Demo of Collaborative play Diablo running in US server).\nSwitch applications using the sidebar on the left.\n\n## Usecases\n\n#### For Consumers.\n- Play any provided application directly from Browser without Installation.\n- i.e, clouddiablo.com is for playing Diablo on Browser collaboratively. When we have less time to finish a game, let's do it together?\n\n#### For Providers\n- Playable Ads: Instead of Video Teaser, Game/Application providers can let users interact with the application.\n- Discoverable: Any application that joined the network will be surfaced to users over CloudMorph channel.\n\n#### For Developers\n- Experience playing/hosting Cloud Gaming on their own.\n- Plugable Cloud gaming module: The cloud gaming core is packaged and virtualized to be extendable to different tech stacks. E.g Python, Java ...\n\n## Getting Started\n### Windows (WIP)\n#### Running in Sandbox (Recommended)\nTo setup Window Sandbox, Turn on Virtualization in Bios and Enable Windows Sandbox Feature. Tutorial https://techgenix.com/install-configure-and-use-windows-sandbox/\n1. Using `setup-sandbox.ps1` to download and install necessary packages (FFMPEG) in sandbox image (`winvm/pkg`)\n2. `go run server.go`\n\n#### Running without Sandbox\nWithout Sandbox, environment is not isolated, so mouse + keyboard simulation will target your main mouse + keyboard. If you play on the same machine, so you will experience your mouse is moving away.\n\n1. Install globally dependencies: FFMPEG. Doesn't need to put in sandbox folder as 1\n1. `go run server.go`\n\n### Mac/Ubuntu\n#### Running locally\n1. Install Dependecies: Docker/Go. Or just `setup.sh` \n2. `go run server.go`\n\n#### Running remotely\n- Run `setup_remote.sh 111.111.111.111` inside `./script`, ``111.111.111.111`` is the address of your host. What you will get your application hosted on your remote machine. More details are in Deployment section below.\n\n#### Debug in case you need\n- If your run is succesful, there will be a Docker running in background. Inside Docker there are 5 apps is running and their logs are suffix with \\_err \\_out\n![screenshot](docs/img/debug.png)\n\n## Design\n\n#### Goal:\n1. **Cloud gaming Philosophy**: The application run in the remote cloud instance. Video/Audio is streamed to users in the most optimal way. User interaction needs to have the lowest latency.\n2. **Cross-platform compatibility**: The service is accessible in web-browser, the universal built-in that can fit multiple platforms like Desktop/Mobile. No console, plugin, external app, or devices are needed.\n3. **Deployment Simplicity**: There is no API/ interface integration required to set up the integration. One line command to finish the deployment.\n4. **Mesh network**: Providers-Consumers over Peer To Peer communication. After joining the network, Provider's Application is discoverable and immediately launched with one selection.\n5. **Modularizable**: A concise technical stack to **develop**/**deploy** for cloud gaming/ cloud application service.\n6. **Scalable**: Able to scale on headless machines cluster horizontally.\n\n#### CloudApp Core\n![screenshot](docs/img/CloudUniverse.png)\n\n1. When a Web Service starts, Application Container, named \"CloudApp Core\", is spawned. Inside the Container there are Application + Virtual Display/Audio + Windows Event Simulation Utility. Multiple Containers can be spawned on demand.\n2. Web Service is in charge of Webapp interface, P2P communication. When a user/client connects the service, the service will initialize a WebRTC connection between the client and service. This project uses [WebRTC Pion](https://github.com/pion/webrtc), which is a fantastic library for WebRTC in Golang.\n3. Input captured from Client is sent to Web Service using WebRTC Data Channel (UDP).\n4. Web Service sends received input events to Virtual Machine over a socket.\n5. The utility (syncinput.exe) listens to the input events and simulates equivalent Windows OS events to Wine Application through WinAPI.\n6. Application screen/ Audio is captured in a Virtual Display Frame Buffer (XVFB)/ Virtual Audio (PulseAudio), which is later piped to FFMPEG.\n7. FFMPEG encodes the Video Stream to RTP (VPX/H264) stream and Audio Stream to Opus stream.  \n8. Overall, \"CloudApp Core\" module receives **Input** as WebSocket event and **Output** as RTP stream. It is packaged in Container with the interface declared at `core/go/cloudapp`.  \n\n#### Decentralize\n![screenshot](docs/img/Decentralize.png)\n\n- Discovery service is a centralized service, backed by etcd. In this flow, Client periodically query this service to get list of joinable host and show them in sidebar.\n- For Provider, if the configuration in `config.yaml` includes `discoveryHost` attribute, application will be discoverable to user.\n\n## Detailed Technology\n[wiki](https://github.com/giongto35/cloud-morph/wiki)\n\n## Development\n\nThe service is built using Golang, C++, and Linux X11 utility tools (Xvfb, ffmpeg).\nYou can set up all dependencies with `setup.sh`. After that, you can run the go server with\n\n- `go run server.go`\n\nAccess to your local at\n\n- `localhost:8080`\n\nNote: the wine application runs inside Docker. You can run it without docker by changing `run-wine.sh` to `run-wine-nodocker.sh` in `server.go` for easier debugging.\n\n### Explore and Contribute\n- [Wiki Deep Dive Into Codebase](https://github.com/giongto35/cloud-morph/wiki/Deep-Dive-Into-Codebase)\n\n## Deployment\n\nFirst, we need an Ubuntu instance with a public network firewall (No firewall rule for P2P communication NAT traversal). You can get a VPS from any provider (like AWS, DigitalOcean)\nWe prepare below in the same directory  \n\n*Required*:  \n1. `config.yaml`: app config, the app configuration.\n2. `apps`: the folder contains the app we will deploy. It is later mapped to `winvn/apps` in the remote instances. For example, `DiabloII`. If your application is already inside the synced wine environment at 2, ex \"Program Files\", we can skip it. We need to configure `config.yaml`, apppath to point to the correct app path.\n3. `setup_remote.sh`: a copy of the script in `winvm/script` to deploy your application to server.  \n\n*Optional*:  \n4. `wine`: whole wine folder from `.wine`. If there is no wine folder, the deployment uses the default `.wine` from installation.\n\nAfter that, we run `setup_remote` from inside the folder:\n- `setup_remote.sh $ip`. Ex: `./setup_remote.sh 159.89.146.77`  \n- Tutorial Video: https://www.youtube.com/watch?v=w8uCkfZdHVc\n\n**Deployment Example**\n- `script/example` contains example applications configuration. Note: `/apps` is left empty due to copyright.\n\n**Deployment with Lutris**\n- Lutris eases the installation of a game on Linux. **The recommended flow is to install game with Lutris and copy produced wine environment in .wine folder to Cloud Morph**.\n\n## Road Map - Request for Help\n\n- UI improvement\n- Full Dockerization. Only core is packaged, server is not run in Container.\n- Port C++ Window API to Rust.\n- GPU acceleration. - Integrate with FFMPEG job. \n- Multiplex application sessions. Currently, only collaborative mode is supported, which serves all application sessions from the same single instance.\n- Performance optimization.\n- Web Mobile controller support. Only mouse click is simulated.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiongto35%2Fcloud-morph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiongto35%2Fcloud-morph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiongto35%2Fcloud-morph/lists"}