{"id":49429193,"url":"https://github.com/poseidon-fan/net-mux","last_synced_at":"2026-04-29T11:01:16.509Z","repository":{"id":316898084,"uuid":"1063900976","full_name":"Poseidon-fan/net-mux","owner":"Poseidon-fan","description":"network connection multiplexing async lib in rust, built on tokio","archived":false,"fork":false,"pushed_at":"2026-04-29T09:16:45.000Z","size":186,"stargazers_count":140,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-04-29T10:35:25.600Z","etag":null,"topics":["async","kcp","multiplexing","network-programming","rust","tcp","tokio"],"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/Poseidon-fan.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-25T09:12:59.000Z","updated_at":"2026-04-29T09:16:44.000Z","dependencies_parsed_at":"2025-09-27T13:20:23.197Z","dependency_job_id":"1a50918b-e2bc-47ec-9121-3750fcbb7f21","html_url":"https://github.com/Poseidon-fan/net-mux","commit_stats":null,"previous_names":["poseidon-fan/net-mux"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Poseidon-fan/net-mux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poseidon-fan%2Fnet-mux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poseidon-fan%2Fnet-mux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poseidon-fan%2Fnet-mux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poseidon-fan%2Fnet-mux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Poseidon-fan","download_url":"https://codeload.github.com/Poseidon-fan/net-mux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poseidon-fan%2Fnet-mux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32422532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["async","kcp","multiplexing","network-programming","rust","tcp","tokio"],"created_at":"2026-04-29T11:00:35.668Z","updated_at":"2026-04-29T11:01:16.494Z","avatar_url":"https://github.com/Poseidon-fan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003enet-mux\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n[![GitHub][github-badge]][github-url]\n[![Crates.io][crates-badge]][crates-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Build Status][actions-badge]][actions-url]\n\n\u003c/div\u003e\n\n[crates-badge]: https://img.shields.io/crates/v/net-mux.svg\n[crates-url]: https://crates.io/crates/net-mux\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit-url]: https://github.com/Poseidon-fan/net-mux/blob/master/LICENSE\n[actions-badge]: https://github.com/Poseidon-fan/net-mux/actions/workflows/rust.yaml/badge.svg\n[actions-url]: https://github.com/Poseidon-fan/net-mux/actions?branch=master\n[github-badge]: https://img.shields.io/badge/github-repo-black?logo=github\n[github-url]: https://github.com/Poseidon-fan/net-mux\n\n`net-mux` is an asynchronous connection multiplexing library built on\nTokio. It turns a single ordered, connection-oriented byte stream\n(TCP, TLS-over-TCP, KCP, ...) into many concurrent bidirectional logical\nstreams.\n\n## Features\n\n- **Credit-based per-stream flow control.** Slow consumers do not stall\n  other streams; total memory is bounded by `max_streams *\n  initial_stream_window`.\n- **Correct `AsyncRead` / `AsyncWrite`.** Large user writes are\n  transparently fragmented; back-pressure surfaces as `Poll::Pending`.\n- **Half-close.** `shutdown()` closes only the write half, mirroring TCP\n  semantics.\n- **Keepalive.** Periodic `Ping` frames with timeout-driven session\n  shutdown.\n- **Graceful close.** `Session::close().await` flushes outstanding frames,\n  emits a `GoAway`, and joins all background tasks.\n- **Lock-free hot paths.** Atomic windows, atomic stream state, single\n  outbound queue.\n\nSee [`docs/architecture.md`](docs/architecture.md) and\n[`docs/protocol.md`](docs/protocol.md) for the deeper design notes.\n\n## Quick start\n\n```rust,no_run\nuse net_mux::{Config, Session};\nuse tokio::io::{AsyncReadExt, AsyncWriteExt};\nuse tokio::net::TcpStream;\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    let conn = TcpStream::connect(\"127.0.0.1:7777\").await?;\n    let session = Session::client(conn, Config::default());\n\n    let mut stream = session.open().await?;\n    stream.write_all(b\"hello\\n\").await?;\n    stream.shutdown().await?;\n\n    let mut buf = Vec::new();\n    stream.read_to_end(\u0026mut buf).await?;\n    println!(\"{}\", String::from_utf8_lossy(\u0026buf));\n\n    session.close().await;\n    Ok(())\n}\n```\n\n## Examples\n\n### Echo\n\n```sh\n$ cargo run --example tcp_server\n$ cargo run --example tcp_client\n```\n\nThe server echoes each line received over a fresh multiplexed stream;\nthe client reads stdin, opens one stream per line, and prints the reply.\n\n### Reverse tunnel\n\n```sh\n$ cargo run --example forward_server   # listens on :7777 (transport) and :8001 (proxy)\n$ cargo run --example forward_client   # connects to :7777, forwards to :8000\n```\n\nIf you start an HTTP service on `127.0.0.1:8000`\n(e.g. `python -m http.server 8000`), it becomes reachable on\n`http://127.0.0.1:8001` via the tunnel.\n\n## Configuration\n\n```rust\nuse net_mux::Config;\nuse std::time::Duration;\n\nlet cfg = Config::builder()\n    .initial_stream_window(512 * 1024)\n    .max_frame_size(64 * 1024)\n    .max_streams(2048)\n    .keepalive_interval(Some(Duration::from_secs(30)))\n    .build();\n```\n\n## Links\n\n- API [docs][documentation]\n- Source [examples][examples]\n- Wire-protocol [spec](docs/protocol.md)\n\n[examples]: https://github.com/Poseidon-fan/net-mux/tree/master/examples\n[documentation]: https://docs.rs/crate/net-mux/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposeidon-fan%2Fnet-mux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposeidon-fan%2Fnet-mux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposeidon-fan%2Fnet-mux/lists"}