{"id":13692163,"url":"https://github.com/codec-abc/Yew-WebRTC-Chat","last_synced_at":"2025-05-02T19:31:33.792Z","repository":{"id":45053893,"uuid":"268253119","full_name":"codec-abc/Yew-WebRTC-Chat","owner":"codec-abc","description":"A simple WebRTC chat made with Yew","archived":false,"fork":false,"pushed_at":"2023-08-17T11:36:50.000Z","size":665,"stargazers_count":124,"open_issues_count":2,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-03T17:13:24.087Z","etag":null,"topics":["chat","rust","wasm","webrtc","yew"],"latest_commit_sha":null,"homepage":"https://codec-abc.github.io/Rust-WebRTC-p2p-Chat/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codec-abc.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-05-31T10:03:02.000Z","updated_at":"2024-06-25T23:45:54.000Z","dependencies_parsed_at":"2024-04-09T23:48:28.323Z","dependency_job_id":"7991f862-9a65-481e-a866-5c46459786d6","html_url":"https://github.com/codec-abc/Yew-WebRTC-Chat","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/codec-abc%2FYew-WebRTC-Chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codec-abc%2FYew-WebRTC-Chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codec-abc%2FYew-WebRTC-Chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codec-abc%2FYew-WebRTC-Chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codec-abc","download_url":"https://codeload.github.com/codec-abc/Yew-WebRTC-Chat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224328522,"owners_count":17293273,"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":["chat","rust","wasm","webrtc","yew"],"created_at":"2024-08-02T17:00:54.298Z","updated_at":"2024-11-12T18:30:26.684Z","avatar_url":"https://github.com/codec-abc.png","language":"Rust","funding_links":[],"categories":["Samples","Projects"],"sub_categories":[],"readme":"# A Yew WebRTC Chat\r\n\r\n## About\r\nThis project showcase a simple HTML chat using WebRTC and programmed in Rust and compiled to WASM. [Live Demo](https://codec-abc.github.io/Rust-WebRTC-p2p-Chat/)\r\n\r\nAfter reading this [wonderful post](https://medium.com/leaningtech/porting-a-c-multiplayer-game-to-the-web-with-cheerp-webrtc-and-firebase-29fbbc62c5ca) by the [Cheerp team](https://leaningtech.com/pages/cheerp.html)\r\nI wanted to see if the same can be done with \"pure\" Rust using WASM.\r\n\r\nSince doing a game from scratch was too complicated as a first step I aimed to just play along with Rust, HTML (using [Yew](https://github.com/yewstack/yew)) and WebRTC by doing a chat application. 3D and WebGL will come another time.\r\n\r\nIt turns out that it is not very difficult to get something working as you can see below:\r\n\r\n![demo](demo.gif)\r\n\r\n## Notes\r\nIf you try to run locally prefer testing with Chrome locally because I encountered issues with Firefox. Also, be wary that some extensions might block WebRTC connections.\r\nAlso, if you are testing with a friend it might not work as I am using only a STUN server. From the tests I made, I found out that the connections are often blocked on corporate networks and using a TURN server would solve the problem. But unlike STUN server there aren't free TURN servers.\r\nFinally, the error handling is not totally done yet as I don't know how I actually handle errors (and also what the WebRTC API allows me to do). If you are stuck reload the page on both side and try again.\r\n\r\n## Build and Run\r\nTo build this project you need to:\r\n1. Install wasm-pack with ``cargo install wasm-pack``\r\n2. Install http-server ``cargo install http-server``\r\n\r\nTo run it once build you need to type\r\n1. Compile code with ``wasm-pack build --target web --no-typescript --out-dir ./static/pkg``\r\n2. Run web server in the ``static`` dir with ``http-server -p 8080`` (Alternatively you can use any static file server like ``python3 -m http.server``)\r\n\r\n## Special thanks\r\n* The [Rust](https://www.rust-lang.org/) team for making a great language\r\n* The [Yew](https://github.com/yewstack/yew) team for making an awesome front-end framework\r\n* [Sajad Hashemian](https://github.com/sajadhsm?tab=repositories) for making this [nice HTML chat](https://codepen.io/sajadhsm/pen/odaBdd) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodec-abc%2FYew-WebRTC-Chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodec-abc%2FYew-WebRTC-Chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodec-abc%2FYew-WebRTC-Chat/lists"}