{"id":13509872,"url":"https://github.com/hashicorp/yamux","last_synced_at":"2025-05-13T15:04:59.750Z","repository":{"id":17303016,"uuid":"20073531","full_name":"hashicorp/yamux","owner":"hashicorp","description":"Golang connection multiplexing library","archived":false,"fork":false,"pushed_at":"2025-03-17T16:05:08.000Z","size":173,"stargazers_count":2340,"open_issues_count":26,"forks_count":246,"subscribers_count":328,"default_branch":"master","last_synced_at":"2025-05-03T03:42:34.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashicorp.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-22T19:08:46.000Z","updated_at":"2025-05-01T12:46:03.000Z","dependencies_parsed_at":"2023-02-17T08:31:15.968Z","dependency_job_id":"821a2817-1822-44da-b149-7ad99b303200","html_url":"https://github.com/hashicorp/yamux","commit_stats":{"total_commits":124,"total_committers":33,"mean_commits":3.757575757575758,"dds":0.5483870967741935,"last_synced_commit":"49eecf38b432cfb1b543d41c782ea17cca090708"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fyamux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fyamux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fyamux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashicorp%2Fyamux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashicorp","download_url":"https://codeload.github.com/hashicorp/yamux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252551905,"owners_count":21766605,"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":[],"created_at":"2024-08-01T02:01:15.540Z","updated_at":"2025-05-05T18:25:10.193Z","avatar_url":"https://github.com/hashicorp.png","language":"Go","funding_links":[],"categories":["开源类库","Go","Open source library","others"],"sub_categories":["网络","The Internet"],"readme":"# Yamux\n\nYamux (Yet another Multiplexer) is a multiplexing library for Golang.\nIt relies on an underlying connection to provide reliability\nand ordering, such as TCP or Unix domain sockets, and provides\nstream-oriented multiplexing. It is inspired by SPDY but is not\ninteroperable with it.\n\nYamux features include:\n\n* Bi-directional streams\n  * Streams can be opened by either client or server\n  * Useful for NAT traversal\n  * Server-side push support\n* Flow control\n  * Avoid starvation\n  * Back-pressure to prevent overwhelming a receiver\n* Keep Alives\n  * Enables persistent connections over a load balancer\n* Efficient\n  * Enables thousands of logical streams with low overhead\n\n## Documentation\n\nFor complete documentation, see the associated [Godoc](http://godoc.org/github.com/hashicorp/yamux).\n\n## Specification\n\nThe full specification for Yamux is provided in the `spec.md` file.\nIt can be used as a guide to implementors of interoperable libraries.\n\n## Usage\n\nUsing Yamux is remarkably simple:\n\n```go\n\nfunc client() {\n    // Get a TCP connection\n    conn, err := net.Dial(...)\n    if err != nil {\n        panic(err)\n    }\n\n    // Setup client side of yamux\n    session, err := yamux.Client(conn, nil)\n    if err != nil {\n        panic(err)\n    }\n\n    // Open a new stream\n    stream, err := session.Open()\n    if err != nil {\n        panic(err)\n    }\n\n    // Stream implements net.Conn\n    stream.Write([]byte(\"ping\"))\n}\n\nfunc server() {\n    // Accept a TCP connection\n    conn, err := listener.Accept()\n    if err != nil {\n        panic(err)\n    }\n\n    // Setup server side of yamux\n    session, err := yamux.Server(conn, nil)\n    if err != nil {\n        panic(err)\n    }\n\n    // Accept a stream\n    stream, err := session.Accept()\n    if err != nil {\n        panic(err)\n    }\n\n    // Listen for a message\n    buf := make([]byte, 4)\n    stream.Read(buf)\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fyamux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashicorp%2Fyamux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashicorp%2Fyamux/lists"}