{"id":15137954,"url":"https://github.com/foxzool/bevy_octopus","last_synced_at":"2026-01-16T21:58:15.313Z","repository":{"id":234458602,"uuid":"788939134","full_name":"foxzool/bevy_octopus","owner":"foxzool","description":"A Low leveling ECS driven network plugin for Bevy.","archived":false,"fork":false,"pushed_at":"2026-01-15T06:15:41.000Z","size":401,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T08:38:37.996Z","etag":null,"topics":["bevy","bevy-plugin","networking"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxzool.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-19T11:40:34.000Z","updated_at":"2026-01-15T06:15:44.000Z","dependencies_parsed_at":"2024-05-20T10:27:04.090Z","dependency_job_id":"87dd6012-9a3b-4412-83f8-d393390b8fd6","html_url":"https://github.com/foxzool/bevy_octopus","commit_stats":null,"previous_names":["foxzool/bevy_com","foxzool/bevy_octopus"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/foxzool/bevy_octopus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_octopus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_octopus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_octopus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_octopus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxzool","download_url":"https://codeload.github.com/foxzool/bevy_octopus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_octopus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28484427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bevy","bevy-plugin","networking"],"created_at":"2024-09-26T07:03:47.859Z","updated_at":"2026-01-16T21:58:15.298Z","avatar_url":"https://github.com/foxzool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/bevy_octopus)](https://crates.io/crates/bevy_octopus)\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/Seldom-SE/seldom_pixel#license)\n[![crates.io](https://img.shields.io/crates/d/bevy_octopus)](https://crates.io/crates/bevy_octopus)\n[![CI](https://github.com/foxzool/bevy_octopus/workflows/CI/badge.svg)](https://github.com/foxzool/bevy_octopus/actions)\n[![Documentation](https://docs.rs/bevy_octopus/badge.svg)](https://docs.rs/bevy_octopus)\n\n# bevy_octopus\n\nA Low-level ECS-driven network plugin for Bevy.\n\n## Usage\n\nAdd this in your Cargo.toml:\n\n```toml\n[dependencies]\nbevy_octopus = { version = \"0.7\", features = [\"serde_json\", \"bincode\"] } # or your custom format\n```\n\n## Example\n\n```ignore,rust \nuse bevy::prelude::*;\nuse bevy_octopus::{\n    prelude::*,\n    transports::{tcp::TcpAddress, udp::UdpAddress},\n};\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Deserialize, Debug, Clone)]\npub struct PlayerInformation {\n    pub health: usize,\n    pub position: (u32, u32, u32),\n}\n\nconst TCP_CHANNEL: ChannelId = ChannelId(\"tcp\");\nconst UDP_CHANNEL: ChannelId = ChannelId(\"udp\");\n\nfn main() {\n    App::new()\n        .add_plugins(DefaultPlugins)\n        .add_plugins(OctopusPlugin)\n        // UDP CHANNEL use json tranformer for PlayerInformation struct\n        .add_transformer::\u003cPlayerInformation, JsonTransformer\u003e(UDP_CHANNEL)\n        // TCP_CHANNEL use json tranformer for PlayerInformation struct\n        .add_transformer::\u003cPlayerInformation, BincodeTransformer\u003e(TCP_CHANNEL)\n        .add_systems(Startup, setup)\n        .add_systems(Update, resend_udp_to_tcp)\n        .add_observer(on_node_event)\n        .run();\n}\n\nfn setup(mut commands: Commands) {\n    // tcp client\n    commands.spawn((\n        NetworkBundle::new(TCP_CHANNEL),\n        ClientNode(TcpAddress::new(\"127.0.0.1:4321\")),\n    ));\n\n    // udp server\n    commands.spawn((\n        NetworkBundle::new(UDP_CHANNEL),\n        ServerNode(UdpAddress::new(\"127.0.0.1:4002\")),\n    ));\n}\n\npub fn on_node_event(on: On\u003cNodeEvent\u003e) {\n    let e = on.event();\n    info!(\"{:?} trigger {:?}\", e.entity, e.event);\n}\n\npub fn resend_udp_to_tcp(\n    mut channel_recviced: MessageReader\u003cReceiveChannelMessage\u003cPlayerInformation\u003e\u003e,\n    mut channel_messages: MessageWriter\u003cSendChannelMessage\u003cPlayerInformation\u003e\u003e,\n) {\n    for event in channel_recviced.read() {\n        info!(\"recevice {:?}\", event.message);\n        if event.channel_id == UDP_CHANNEL {\n            channel_messages.write(SendChannelMessage {\n                channel_id: TCP_CHANNEL,\n                message: event.message.clone(),\n            });\n        }\n    }\n}\n\n```\n\n## Features\n\n### ECS driven network\n\nEvery network node is a component, so you can easily manage network entities with Bevy ECS.\n\nApps can be many servers and many clients at the same time.\n\n### Flexible network protocol decoder\n\nYou can define channel transformers for data serialization and deserialization.\n\n### UDP Communication Types\n\nSupport UDP [unicast](https://github.com/foxzool/bevy_octopus/blob/main/examples/udp/client_raw.rs), broadcast,\nmulticast. [example](https://github.com/foxzool/bevy_octopus/blob/main/examples/udp/udp_complex.rs)\n\n### No tokio runtime\n\n## Supported Network Protocol\n\n| Protocol  | Server | Client | Sever with SSL | Client with SSL |\n|-----------|--------|--------|----------------|-----------------|\n| UDP       | ✅      | ✅      | ✘              | ✘               |\n| TCP       | ✅      | ✅      | ☐              | ☐               |\n| Websocket | ✅      | ✅      | ☐              | ☐               |\n\n## Network Components\n\n|                | ServerNode | ClientNode | NetworkPeer |\n|----------------|------------|------------|-------------|\n| server         | ✓          |            |             |\n| client         |            | ✓          |             |\n| client session |            | ✓          | ✓           |\n\n## Supported Versions\n\n| bevy | bevy_octopus |\n|------|--------------|\n| 0.18 | 0.7          |\n| 0.17 | 0.6          |\n| 0.16 | 0.5          |\n| 0.15 | 0.4          |\n| 0.14 | 0.2 , 0.3    |\n| 0.13 | 0.1          |\n\n# License\n\nAll code in this repository is dual-licensed under either:\n\n- MIT License (LICENSE-MIT or \u003chttp://opensource.org/licenses/MIT\u003e)\n- Apache License, Version 2.0 (LICENSE-APACHE or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n\nat your option. This means you can select the license you prefer.\n\n## Your contributions\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_octopus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxzool%2Fbevy_octopus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_octopus/lists"}