{"id":23887085,"url":"https://github.com/tlabaltoh/rust-server-for-multiplayer","last_synced_at":"2025-08-08T04:17:38.195Z","repository":{"id":270107622,"uuid":"862627559","full_name":"TLabAltoh/rust-server-for-multiplayer","owner":"TLabAltoh","description":"This is an SFU (Selectable Forwarding Unit) server for relaying WebRTC and WebSocket packets. Intended for use in a realtime multiplayer game. This repository's webrtc implementation is mostly based on binbat's live777 and webrtc-rs.","archived":false,"fork":false,"pushed_at":"2025-01-30T09:23:12.000Z","size":8034,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T02:19:01.544Z","etag":null,"topics":["audio","game-server","multiplayer","multiplayer-server","network","networking","rust","rust-lang","server","sfu","sfu-server","trickle-ice","unity","video","webrtc","webrtc-server","websocket","whep","whip"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TLabAltoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-24T23:23:25.000Z","updated_at":"2025-01-30T09:23:15.000Z","dependencies_parsed_at":"2025-01-03T18:39:29.846Z","dependency_job_id":"2e1b985a-36bf-4a19-8e02-49452adfa135","html_url":"https://github.com/TLabAltoh/rust-server-for-multiplayer","commit_stats":null,"previous_names":["tlabaltoh/unity-rust-sfu","tlabaltoh/rust-server-for-multiplayer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLabAltoh%2Frust-server-for-multiplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLabAltoh%2Frust-server-for-multiplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLabAltoh%2Frust-server-for-multiplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TLabAltoh%2Frust-server-for-multiplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TLabAltoh","download_url":"https://codeload.github.com/TLabAltoh/rust-server-for-multiplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991558,"owners_count":21194894,"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":["audio","game-server","multiplayer","multiplayer-server","network","networking","rust","rust-lang","server","sfu","sfu-server","trickle-ice","unity","video","webrtc","webrtc-server","websocket","whep","whip"],"created_at":"2025-01-04T07:29:23.576Z","updated_at":"2025-04-15T02:19:06.512Z","avatar_url":"https://github.com/TLabAltoh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"media/header.png\" width=\"800\"\u003e\u003c/img\u003e\n\n# rust-server-for-multiplayer\nThis is an SFU (Selectable Forwarding Unit) server for relaying [WebRTC](https://webrtc.org/?hl=en) and [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) packets. Intended for use in a realtime multiplayer game. This repository's webrtc implementation is mostly based on [binbat](https://github.com/binbat)'s [live777](https://github.com/binbat/live777) and [webrtc-rs](https://github.com/webrtc-rs/webrtc). \n\n\u003e [!WARNING]  \n\u003e I am not a member or contributor of [original source](https://github.com/binbat/live777). Please note that my modification may have dropped original source's critical features. \n\n[sample unity project is here](https://github.com/TLabAltoh/Unity-SFU-Integration.git)\n\n## Feature\n- [x] ```Broadcast```\n- [x] ```Unicast (by user id)```\n- [ ] ```Multicast```\n### WebRTC\n- [x] ```DataChannel```\n- [x] ```Audio```\n- [x] ```Video```\n- [x] ```Trickle-ICE```\n- [ ] ```Vanilla-ICE (No plans at the moment.)```\n### WebSocket\n- [x] ```Binary```\n- [ ] ```Text (No plans at the moment.)```\n### Network Event (with ```user id```)\n- [x] ```OnOpen```\n- [x] ```OnClose```\n\n## Overview\n\u003cimg src=\"media/graph.0.drawio.svg\" width=\"512\" style=\"border-radius:10px\"\u003e\u003c/img\u003e\n\nIn this repository, you can use ```whep``` without ```whip``` in ```WebRTC```. When ```whep``` is called without ```whip```, the server prepares the dummy ```whip```. it assumes use cases for data streams that do not need an owner (like synchronising the transform of a gameobject and so on ...).\n\n## Get Started\n\n### Install\nClone this repository with the following command\n```bat\ngit clone https://github.com/TLabAltoh/rust-server-for-multiplayer.git\n```\n\n### Build\n```bat\ncd REPOSITORY_ROOT\nbuild-*.bat\n```\n\n### Run\n\n```bat\ncd REPOSITORY_ROOT\nrun-*.bat\n```\n\n### Client implementation Sample and Debug with browser\nThis repository contains a browser-based debugging tool. Prepare the media (```mp3``` and ```mp4```) of your choice and Run the command below to open it.\n\n```bat\ncd REPOSITORY_ROOT\nmkdir assets\\webui\\media\n\n@rem put the media (please set the name to sample-audio.mp3 and sample-video.mp4) of your choice. \n\n@rem ls\n@rem sample-audio.mp3  sample-video.mp4\n```\n\n#### Chrome\n```bat\ncd REPOSITORY_ROOT\nrun-debug.bat\n\nstart chrome http://localhost:7777 --auto-open-devtools-for-tabs\n```\n\n#### Firefox\n```bat\ncd REPOSITORY_ROOT\nrun-debug.bat\n\nstart firefox http://localhost:7777 -devtools\n```\n\nAlso, client implementation sample with ```javascript``` has been puted in ```./assets/webui/``` and used as part of ```debug-tool```'s module. Currently, it only has the function of just ```(join / exit) Room``` and ```(send / receive) MediaStream / DataChannel / WebSocket```. This repository only contains ```javascript``` client implementation examples. The ```C#``` version of the ```Unity``` client implementation example is maintained in a separate repository ([unity's sample is here !](https://github.com/TLabAltoh/Unity-SFU-Integration.git)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlabaltoh%2Frust-server-for-multiplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlabaltoh%2Frust-server-for-multiplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlabaltoh%2Frust-server-for-multiplayer/lists"}