{"id":15894495,"url":"https://github.com/oyyd/tokio_smux","last_synced_at":"2026-05-09T23:53:30.133Z","repository":{"id":216942502,"uuid":"739701858","full_name":"oyyd/tokio_smux","owner":"oyyd","description":"Smux protocol in Rust. Provide multiplexing for reliable streams.","archived":false,"fork":false,"pushed_at":"2024-01-20T07:10:08.000Z","size":91,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T07:36:30.662Z","etag":null,"topics":["multiplexing","muxing","smux","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/oyyd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-01-06T09:25:04.000Z","updated_at":"2024-12-19T09:19:07.000Z","dependencies_parsed_at":"2024-10-06T08:40:30.826Z","dependency_job_id":"0addf9cb-7789-4472-a78e-2b49cec68a72","html_url":"https://github.com/oyyd/tokio_smux","commit_stats":null,"previous_names":["oyyd/tokio_smux"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Ftokio_smux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Ftokio_smux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Ftokio_smux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyyd%2Ftokio_smux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oyyd","download_url":"https://codeload.github.com/oyyd/tokio_smux/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240981565,"owners_count":19888346,"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":["multiplexing","muxing","smux","tokio"],"created_at":"2024-10-06T08:40:25.217Z","updated_at":"2026-05-09T23:53:25.104Z","avatar_url":"https://github.com/oyyd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tokio_smux\n\n[![Build And Test](https://github.com/oyyd/tokio_smux/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/oyyd/tokio_smux/actions) [![crates.io](https://img.shields.io/crates/v/tokio_smux.svg)](https://crates.io/crates/tokio_smux)\n\nTokio_smux is an implementation of [smux](https://github.com/xtaci/smux/) in Rust, which is a stream multiplexing library in Golang.\n\nTokio_smux can work with tokio [TcpStream](https://docs.rs/tokio/latest/tokio/net/struct.TcpStream.html) and [KcpStream](https://docs.rs/tokio_kcp/latest/tokio_kcp/struct.KcpStream.html). It can also be used with any streams that implement tokio's `AsyncRead` and `AsyncWrite` traits.\n\n## Docs\n\n[https://docs.rs/tokio_smux](https://docs.rs/tokio_smux)\n\n## Usage Example\n\nSee [examples](./examples)\n\n## Smux Protocol Implementation\n\nThe smux protocl version 2 is not yet supported.\n\n**Why doesn't `Stream` of tokio_smux impl `AsyncRead` and `AysncWrite` itself?**\n\nBecuase the smux protocol uses frames, means all user data transfered is wrapped in frames of fixed lengths. Similar to the websocket protocol.\n\nUsing frames has its benifits: it maintains message boundaries.\nFor example, you can send many one byte data messages to the remote, and receive them one by one in the remote.\n\nIt's still feasible to wrap the current APIs of `Stream` to provide `AsyncRead` and `AsyncWrite`. However, this approach introduces additional overhead and loses message boundaries.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyyd%2Ftokio_smux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foyyd%2Ftokio_smux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyyd%2Ftokio_smux/lists"}