{"id":20850584,"url":"https://github.com/multiformats/ma-pipe","last_synced_at":"2025-05-12T04:31:33.488Z","repository":{"id":11011199,"uuid":"67987121","full_name":"multiformats/ma-pipe","owner":"multiformats","description":"multiaddr powered pipes","archived":false,"fork":false,"pushed_at":"2025-03-28T13:06:15.000Z","size":50,"stargazers_count":7,"open_issues_count":4,"forks_count":4,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-28T14:22:50.810Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/multiformats.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}},"created_at":"2016-09-12T07:40:46.000Z","updated_at":"2025-03-28T13:06:20.000Z","dependencies_parsed_at":"2025-03-28T14:22:44.409Z","dependency_job_id":"b780d8fc-ca85-4f31-bb39-ac24ff6f8937","html_url":"https://github.com/multiformats/ma-pipe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fma-pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fma-pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fma-pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiformats%2Fma-pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiformats","download_url":"https://codeload.github.com/multiformats/ma-pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253675289,"owners_count":21945923,"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-11-18T03:10:23.074Z","updated_at":"2025-05-12T04:31:33.181Z","avatar_url":"https://github.com/multiformats.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ma-pipe - multiaddr pipes\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](https://github.com/multiformats/multiformats)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](https://webchat.freenode.net/?channels=%23ipfs)\n[![](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n[![Travis CI](https://img.shields.io/travis/multiformats/ma-pipe.svg?style=flat-square\u0026branch=master)](https://travis-ci.org/multiformats/ma-pipe)\n[![codecov.io](https://img.shields.io/codecov/c/github/multiformats/ma-pipe.svg?style=flat-square\u0026branch=master)](https://codecov.io/github/multiformats/ma-pipe?branch=master)\n\n\u003e multiaddr powered pipes\n\nThis is a simple program, much like netcat or telnet, that sets up pipes between [multiaddrs](https://github.com/multiformats/multiaddr).\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n  - [CLI Usage Text](#cli-usage-text)\n  - [Tee (`--tee`)](#tee---tee)\n  - [Traces (`--trace`)](#traces---trace)\n  - [Rate Limiting (`--bandwidth`)](#rate-limiting-bandwidth)\n- [Maintainer](#maintainer)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\nFor now, use `go get` to install it:\n\n```\ngo get -u github.com/multiformats/ma-pipe/ma-pipe\nma-pipe --version # should work\n```\n\nPlease file an issue if there is a problem with the install.\n\n## Usage\n\n`ma-pipe` sets up simple pipes based on multiaddrs. It has four modes:\n\n- `listen` will listen on 2 given multiaddrs, accept 1 conn each, and pipe the connection together\n- `dial` will dial to 2 given multiaddrs, and pipe the connection together\n- `fwd` will listen on 1 multiaddr, accept 1 conn, then dial the other given multiaddr\n- `proxy` will listen on 1 multiaddr, accept 1 conn, read a multiaddr from the conn, and dial it\n\nNotes:\n\n- `ma-pipe` supports \"zero\" listen multiaddrs (eg `ma-pipe proxy /ip4/0.0.0.0/tcp/0`)\n- `ma-pipe` supports the `/unix/stdio` multiaddr (eg `ma-pipe fwd /unix/stdio /ip4/127.0.0.1/tcp/1234`)\n\n### CLI Usage Text\n\n```sh\n\u003e ma-pipe --help\nUSAGE\n\tma-pipe \u003cmode\u003e \u003cmultiaddrs\u003e...\n\n\tma-pipe listen \u003clisten-multiaddr1\u003e \u003clisten-multiaddr2\u003e\n\tma-pipe dial \u003cdial-multiaddr1\u003e \u003cdial-multiaddr2\u003e\n\tma-pipe fwd \u003clisten-multiaddr\u003e \u003cdial-multiaddr\u003e\n\tma-pipe proxy \u003clisten-multiaddr\u003e\n\nOPTIONS\n\t-h, --help               display this help message\n\t-v, --version            display the version of the program\n\t-t, --trace \u003cdir\u003e        save a trace of the connection to \u003cdir\u003e\n\t-e, --tee                tee the connection to stdio\n\t--bandwidth \u003cbandwidth\u003e  introduce a bandwidth cap (eg 1MB/s)\n\nEXAMPLES\n\t# listen on two multiaddrs, accept 1 conn each, and pipe them\n\tma-pipe listen /ip4/127.0.0.1/tcp/1234 /ip4/127.0.0.1/tcp/1234\n\n\t# dial to both multiaddrs, and pipe them\n\tma-pipe dial /ip4/127.0.0.1/tcp/1234 /ip4/127.0.0.1/tcp/1234\n\n\t# listen on one multiaddr, accept 1 conn, dial to the other, and pipe them\n\tma-pipe fwd /ip4/127.0.0.1/tcp/1234 /ip4/127.0.0.1/tcp/1234\n\n\t# listen on one multiaddr, accept 1 conn.\n\t# read the first line, parse a multiaddr, dial that multiaddr, and pipe them\n\tma-pipe proxy /ip4/127.0.0.1/tcp/1234\n\n\t# ma-pipe supports \"zero\" listen multiaddrs\n\tma-pipe proxy /ip4/0.0.0.0/tcp/0\n\n\t# ma-pipe supports the /unix/stdio multiaddr\n\tma-pipe fwd /unix/stdio /ip4/127.0.0.1/tcp/1234\n\n\t# ma-pipe supports the --tee option to inspect conn in stdio\n\tma-pipe --tee fwd /ip4/0.0.0.0/tcp/0 /ip4/127.0.0.1/tcp/1234\n\n\t# ma-pipe allows throttling connections with a bandwidth max\n\tma-pipe --bandwidth 1MB/s listen /ip4/127.0.0.1/tcp/1234 /ip4/127.0.0.1/tcp/1234\n\n```\n\n### Tee (`--tee`)\n\nThe `-e, --tee` option allows the user to inspect the connection in stdio, as it happens.\n\n```sh\n\u003e ma-pipe --tee listen /ip4/127.0.0.1/tcp/64829 /ip4/127.0.0.1/tcp/64830\n# listening on /ip4/127.0.0.1/tcp/64829\n# listening on /ip4/127.0.0.1/tcp/64830\n# accepted /ip4/127.0.0.1/tcp/64830 /ip4/127.0.0.1/tcp/64853\n# accepted /ip4/127.0.0.1/tcp/64829 /ip4/127.0.0.1/tcp/64855\n# piping /ip4/127.0.0.1/tcp/64853 to /ip4/127.0.0.1/tcp/64855\n\u003e Hello there\n\u003c Hi!\n\u003e How's it going?\n\u003c Well, and you?\n```\n\n\n### Traces (`--trace`)\n\nThe `-t, --trace` option allows the user to specify a directory to capture a trace of the connection. Three files will be written:\n\n- `\u003ctrace-dir\u003e/ma-pipe-trace-\u003cdate\u003e-\u003cpid\u003e-a2b` for one side of the (duplex) connection.\n- `\u003ctrace-dir\u003e/ma-pipe-trace-\u003cdate\u003e-\u003cpid\u003e-b2a` for the other side of the (duplex) connection.\n- `\u003ctrace-dir\u003e/ma-pipe-trace-\u003cdate\u003e-\u003cpid\u003e-ctl` for control messages.\n\n```\n\u003e tree mytraces\nmytraces\n├── ma-pipe-trace-2016-09-12-03:35:31Z-14088-a2b\n├── ma-pipe-trace-2016-09-12-03:35:31Z-14088-b2a\n└── ma-pipe-trace-2016-09-12-03:35:31Z-14088-ctl\n```\n\n### Rate Limiting (`--bandwidth`)\n\nThe `--bandwidth` option allows users to specify rate-limiting through a maximum bandwidth. The flag uses [go-humanize](https://github.com/dustin/go-humanize) to read formats like `1MB/s` and `4Bps`.\n\n```\n\u003e time head -c 16777216 /dev/urandom | ./ma-pipe --bandwidth 1MB/s fwd /unix/stdio /ip4/127.0.0.1/tcp/5432\n...\n./ma-pipe --bandwidth 1MB/s fwd /unix/stdio /ip4/127.0.0.1/tcp/5432  0.09s user 0.39s system 2% cpu 16.056 total\n\n\u003e time head -c 16777216 /dev/urandom | ./ma-pipe --bandwidth 4MB/s fwd /unix/stdio /ip4/127.0.0.1/tcp/5432\n...\n./ma-pipe --bandwidth 4MB/s fwd /unix/stdio /ip4/127.0.0.1/tcp/5432  0.20s user 0.37s system 14% cpu 4.062 total\n```\n\n## Maintainers\n\nCaptain: [@jbenet](https://github.com/jbenet).\n\n## Contribute\n\nContributions welcome. Please check out [the issues](https://github.com/multiformats/ma-pipe/issues).\n\nCheck out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to multiformats are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\n[MIT](LICENSE) © 2016 Protocol Labs Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fma-pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiformats%2Fma-pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiformats%2Fma-pipe/lists"}