{"id":36454485,"url":"https://github.com/flben233/mtmux","last_synced_at":"2026-01-11T23:01:35.411Z","repository":{"id":329077960,"uuid":"1118004611","full_name":"flben233/mtmux","owner":"flben233","description":"Multiple Tunnels Multiplexer","archived":false,"fork":false,"pushed_at":"2025-12-20T17:33:29.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-20T19:56:43.848Z","etag":null,"topics":["golang","golang-library","multiplexer","network","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/flben233.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-12-17T06:01:36.000Z","updated_at":"2025-12-20T18:18:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/flben233/mtmux","commit_stats":null,"previous_names":["flben233/mtmux"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/flben233/mtmux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flben233%2Fmtmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flben233%2Fmtmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flben233%2Fmtmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flben233%2Fmtmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flben233","download_url":"https://codeload.github.com/flben233/mtmux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flben233%2Fmtmux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["golang","golang-library","multiplexer","network","tcp"],"created_at":"2026-01-11T23:01:35.328Z","updated_at":"2026-01-11T23:01:35.388Z","avatar_url":"https://github.com/flben233.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multiple Tunnels Multiplexing (mtmux)\n\nmtmux is a Go library that enables multiplexing multiple logical streams over multiple TCP tunnels. It allows for efficient data transfer by distributing the load across several connections, improving performance and reliability.\n\n```mermaid\ngraph LR\n    S1[Stream 1]\n    S2[Stream 2]\n    S3[Stream 3]\n    S4[Stream 4]\n    S5[Stream 5]\n    S6[Stream 6]\n\n    Sp1[Stream 1']\n    Sp2[Stream 2']\n    Sp3[Stream 3']\n    Sp4[Stream 4']\n    Sp5[Stream 5']\n    Sp6[Stream 6']\n\n    A((A))\n    B((B))\n\n    subgraph Middle[Multiplexer]\n        L1[Link 1]\n        L2[Link 2]\n        L3[Link 3]\n    end\n\n    S1 --\u003e A\n    S2 --\u003e A\n    S3 --\u003e A\n    S4 --\u003e A\n    S5 --\u003e A\n    S6 --\u003e A\n\n    A --\u003e L1\n    A --\u003e L2\n    A --\u003e L3\n\n    L1 --\u003e B\n    L2 --\u003e B\n    L3 --\u003e B\n\n    B --\u003e Sp1\n    B --\u003e Sp2\n    B --\u003e Sp3\n    B --\u003e Sp4\n    B --\u003e Sp5\n    B --\u003e Sp6\n\n    %% 定义样式：所有文本为黑色\n    classDef stream fill:#e6f3ff,stroke:#3399ff,color:black;\n    classDef link fill:#fff2e6,stroke:#ff9933,color:black;\n    classDef point fill:#f0f0f0,stroke:#666,stroke-width:2px,color:black;\n    classDef subgraphLabel color:black;\n\n    %% 应用样式\n    class S1,S2,S3,S4,S5,S6,Sp1,Sp2,Sp3,Sp4,Sp5,Sp6 stream\n    class L1,L2,L3 link\n    class A,B point\n\n    %% 强制子图标题也为黑色（部分渲染器支持）\n    class Left,Right,Middle subgraphLabel\n```\n\n## Install\n\n```shell\ngo get github.com/flben233/mtmux\n```\n\n## Example\n\nServer:\n\n```go\n// Get a default configuration\ncfg := mtmux.DefaultConfig()\n\n// Listen for incoming connections. This will use the port range from 12345 to 12345 + Tunnels - 1\nln, _ := mtmux.Listen(\"tcp\", \"127.0.0.1:12345\", int(cfg.Tunnels))\ndefer ln.Close()\nbundle, _ := ln.Accept()\n\n// Create a new server session\nsession, _ := mtmux.Server(bundle, cfg)\nsession.Start(context.Background())\ndefer session.Close()\n\n// Accept a new stream\nstream, _ := session.AcceptStream()\n\n// Write and read some data\nstream.Write([]byte(\"hello\"))\nbuf := make([]byte, 1024)\nn, _ := stream.Read(buf)\n\nfmt.Println(string(buf[:n]))\n```\n\nClient:\n\n```go\n// Get a default configuration\ncfg := mtmux.DefaultConfig()\n\n// Dial to the server\nbundle, _ := mtmux.Dial(\"tcp\", \"127.0.0.1:12345\", int(cfg.Tunnels))\n\n// Create a new client session\nsession, _ := mtmux.Client(bundle, cfg)\nsession.Start(context.Background())\ndefer session.Close()\n\n// Open a new stream\nstream, _ := session.OpenStream()\n\n// Write and read some data\nbuf := make([]byte, 1024)\nn, _ := stream.Read(buf)\n_, _ = stream.Write([]byte(\"world\"))\n\nfmt.Println(string(buf[:n]))\n```\n\n## Configuration\n\n- `Tunnels`: Number of TCP tunnels to use for multiplexing.\n- `KeepAliveInterval`: Interval for sending keep-alive messages.\n- `KeepAliveTimeout`: Timeout duration for keep-alive messages.\n- `Timeout`: Timeout duration for waiting for missing data frames.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflben233%2Fmtmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflben233%2Fmtmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflben233%2Fmtmux/lists"}