{"id":13637261,"url":"https://github.com/b23r0/rust-raknet","last_synced_at":"2025-04-19T08:33:57.570Z","repository":{"id":39831760,"uuid":"468711303","full_name":"b23r0/rust-raknet","owner":"b23r0","description":"RakNet Protocol implementation by Rust.","archived":false,"fork":false,"pushed_at":"2024-03-29T12:08:12.000Z","size":323,"stargazers_count":223,"open_issues_count":8,"forks_count":18,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-31T11:52:22.687Z","etag":null,"topics":["minecraft","networking","raknet","reliable-udp","udp","udp-protocol"],"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/b23r0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-11T10:46:29.000Z","updated_at":"2024-10-19T14:13:28.000Z","dependencies_parsed_at":"2024-06-19T03:13:33.020Z","dependency_job_id":null,"html_url":"https://github.com/b23r0/rust-raknet","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b23r0%2Frust-raknet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b23r0%2Frust-raknet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b23r0%2Frust-raknet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b23r0%2Frust-raknet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b23r0","download_url":"https://codeload.github.com/b23r0/rust-raknet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223795266,"owners_count":17204137,"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":["minecraft","networking","raknet","reliable-udp","udp","udp-protocol"],"created_at":"2024-08-02T00:01:13.991Z","updated_at":"2024-11-09T06:31:12.448Z","avatar_url":"https://github.com/b23r0.png","language":"Rust","funding_links":[],"categories":["Libraries","库 Libraries"],"sub_categories":["Network programming","网络编程 Network programming"],"readme":"# rust-raknet [![Build Status](https://img.shields.io/github/workflow/status/b23r0/rust-raknet/Rust)](https://github.com/b23r0/rust-raknet/actions/workflows/rust.yml) [![ChatOnDiscord](https://img.shields.io/badge/chat-on%20discord-blue)](https://discord.gg/ZKtYMvDFN4) [![Crate](https://img.shields.io/crates/v/rust-raknet)](https://crates.io/crates/rust-raknet) [![Crate](https://img.shields.io/docsrs/rust-raknet/latest)](https://docs.rs/rust-raknet/latest/rust_raknet/) \nRakNet Protocol implementation by Rust.\n\nRaknet is a reliable udp transport protocol that is generally used for communication between game clients and servers, and is used by Minecraft Bedrock Edtion for underlying communication.\n\nRaknet protocol supports various reliability options, and has better transmission performance than TCP in unstable network environments. This project is an incomplete implementation of the protocol by reverse engineering.\n\nRequires \u003e= *Tokio 1.x* asynchronous runtime support.\n\nReference : http://www.jenkinssoftware.com/raknet/manual/index.html\n\n_This project is not affiliated with Jenkins Software LLC nor RakNet._\n\n# Features\n\n* Async\n* MIT License\n* Pure Rust implementation\n* Fast Retransmission\n* Selective Retransmission (TCP/Full Retransmission)\n* Non-delayed ACK (TCP/Delayed ACK)\n* RTO Not Doubled (TCP/RTO Doubled)\n* Linux/Windows/Mac/BSD support\n* Compatible with Minecraft\n\n# Get Started\n\n```toml\n# Cargo.toml\n[dependencies]\nrust-raknet = \"*\"\n```\n\nDocumentation : https://docs.rs/rust-raknet/latest/rust_raknet/\n\n# Reliability\n\n- [x] unreliable\n- [x] unreliable sequenced\n- [x] reliable\n- [x] reliable ordered\n- [x] reliable sequenced\n\n# Example\n\n```rs\n//server\n\nasync fn serve(){\n    let mut listener = RaknetListener::bind(\"127.0.0.1:19132\".parse().unwrap()).await.unwrap();\n    listener.listen().await;\n    loop{\n        let socket = listener.accept().await.unwrap();\n        let buf = socket.recv().await.unwrap();\n        if buf[0] == 0xfe{\n            //do something\n        }\n    }\n    listener.close().await.unwrap();\n}\n\n```\n\n```rs\n//client\n\nasync fn connect(){\n    let socket = RaknetSocket::connect(\"127.0.0.1:19132\".parse().unwrap()).await.unwrap();\n    socket.send(\u0026[0xfe], Reliability::ReliableOrdered).await.unwrap();\n    let buf = socket.recv().await.unwrap();\n    if buf[0] == 0xfe{\n        //do something\n    }\n    socket.close().await.unwrap();\n}\n```\n\n# Benchmark\n\nUse Tcp to compare with this project. Set the server packet loss rate to 50%, the client connects to the server, and the server sends an 800-byte packet every 30ms, a total of 100 times. The client counts the delay time of each received data, and calculates the average time of receiving 100 times. The following results are obtained.\n\nTest code: https://github.com/b23r0/rust-raknet/blob/main/example/test_benchmark/src/main.rs\n\nResult:\n\n![image]( https://github.com/b23r0/rust-raknet/blob/main/images/benchmark20220612.jpg)\n\n(June 12, 2022)\n\nIn the network environment with high packet loss rate, this project can reduce the delay time by about 50% compared with TCP.\n\n# Contributing\n\nOptions :\n\n* Report a BUG\n* Submit an ISSUE about suggestion\n* Submit a improved PR\n* Add an example of using rust-raknet\n* Supplement the documentation about using rust-raknet\n\nThanks go to these wonderful people.\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/b23r0\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/35518985?v=3?s=100\" width=\"50px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eb23r0\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/nounfve\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/73693057?v=3?s=100\" width=\"50px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003enounfve\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\nContributions of any kind are welcome! If you've ever wanted to contribute to open source, and a great cause, now is your chance!\n\n# Donation\n\nBTC : 1HeroYcNYMhjsq8RYCx1stSaRZnQd9B9Eq\n\nETH : 0x9999997B3deF7b69c09D7a9CA65E5242fb04a764\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb23r0%2Frust-raknet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb23r0%2Frust-raknet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb23r0%2Frust-raknet/lists"}