{"id":13612665,"url":"https://github.com/aperturerobotics/bifrost","last_synced_at":"2026-04-18T09:06:11.903Z","repository":{"id":43878878,"uuid":"137167041","full_name":"aperturerobotics/bifrost","owner":"aperturerobotics","description":"Modular networking for Go with pluggable transports, RPC, WebRTC, WebAssembly support.","archived":false,"fork":false,"pushed_at":"2026-04-17T03:03:29.000Z","size":14352,"stargazers_count":570,"open_issues_count":2,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-04-17T05:11:09.622Z","etag":null,"topics":["go","nats","peer-to-peer","rpc","webassembly","websocket"],"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/aperturerobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-06-13T05:35:29.000Z","updated_at":"2026-04-16T06:15:01.000Z","dependencies_parsed_at":"2026-01-13T13:06:53.793Z","dependency_job_id":null,"html_url":"https://github.com/aperturerobotics/bifrost","commit_stats":{"total_commits":1057,"total_committers":5,"mean_commits":211.4,"dds":0.4701986754966887,"last_synced_commit":"283749dc751bb1f58a115452b376c2cf9fa6c349"},"previous_names":[],"tags_count":238,"template":false,"template_full_name":null,"purl":"pkg:github/aperturerobotics/bifrost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperturerobotics%2Fbifrost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperturerobotics%2Fbifrost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperturerobotics%2Fbifrost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperturerobotics%2Fbifrost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aperturerobotics","download_url":"https://codeload.github.com/aperturerobotics/bifrost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aperturerobotics%2Fbifrost/sbom","scorecard":{"id":346692,"data":{"date":"2023-03-21","repo":{"name":"github.com/aperturerobotics/bifrost","commit":"aad633bac8e0b34e5d6545c7bb0f1824be9f11d0"},"scorecard":{"version":"v4.10.2","commit":"376f465c111c39c6a5ad7408e8896cd790cb5219"},"score":8.6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#binary-artifacts"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#branch-protection"}},{"name":"CI-Tests","score":10,"reason":"22 out of 22 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#ci-tests"}},{"name":"CII-Best-Practices","score":0,"reason":"no badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":7,"reason":"22 out of last 30 changesets reviewed before merge -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#code-review"}},{"name":"Contributors","score":10,"reason":"6 different organizations found -- score normalized to 10","details":["Info: contributors work for IrcDotNet,MeteorCommunity,airnet,aperturerobotics,oortcloud,rgraphql"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#contributors"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: Renovabot detected: .github/renovate.json:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#dependency-update-tool"}},{"name":"Fuzzing","score":-1,"reason":"internal error: internal error: Client.Search.Code: Search.Code: GET https://api.github.com/search/code?q=github.com+aperturerobotics+bifrost+repo%3Agoogle%2Foss-fuzz+in%3Afile+filename%3Aproject.yaml: 403 You have exceeded a secondary rate limit. Please wait a few minutes before you try again. []","details":null,"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: License file found in expected location: LICENSE:1","Info: FSF or OSI recognized license: LICENSE:1"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#license"}},{"name":"Maintained","score":10,"reason":"30 commit(s) out of 30 and 2 issue activity out of 9 found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"no published package detected","details":["Warn: no GitHub publishing workflow detected"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info: GitHub-owned GitHubActions are pinned","Info: Third-party GitHubActions are pinned","Info: Dockerfile dependencies are pinned","Info: no insecure (not pinned by hash) dependency downloads found in Dockerfiles","Info: no insecure (not pinned by hash) dependency downloads found in shell scripts"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":-1,"reason":"internal error: Client.Search.Code: Search.Code: GET https://api.github.com/search/code?q=github+codeql-action+analyze+repo%3Aaperturerobotics%2Fbifrost+path%3A%2F.github%2Fworkflows: 403 You have exceeded a secondary rate limit. Please wait a few minutes before you try again. []","details":["Info: all commits (22) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#sast"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":null,"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":["Warn: no GitHub releases found"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#signed-releases"}},{"name":"Token-Permissions","score":10,"reason":"tokens are read-only in GitHub workflows","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:13","Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:20","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:21","Info: topLevel 'contents' permission set to 'read': .github/workflows/dependency-review.yml:11","Info: topLevel permissions set to 'read-all': .github/workflows/scorecards.yml:18","Info: jobLevel 'contents' permission set to 'read': .github/workflows/scorecards.yml:29","Info: jobLevel 'actions' permission set to 'read': .github/workflows/scorecards.yml:30","Info: topLevel 'contents' permission set to 'read': .github/workflows/tests.yml:12"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#token-permissions"}},{"name":"Vulnerabilities","score":-1,"reason":"internal error: vulnerabilitiesClient.ListUnfixedVulnerabilities: osvscanner.DoScan: vulnerabilities found","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/376f465c111c39c6a5ad7408e8896cd790cb5219/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T07:12:55.723Z","repository_id":43878878,"created_at":"2025-08-18T07:12:55.723Z","updated_at":"2025-08-18T07:12:55.723Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31962892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","nats","peer-to-peer","rpc","webassembly","websocket"],"created_at":"2024-08-01T20:00:32.948Z","updated_at":"2026-04-18T09:06:11.860Z","avatar_url":"https://github.com/aperturerobotics.png","language":"Go","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"readme":"![Bifrost](./doc/img/bifrost-logo.png)\n\n## Introduction\n\n**Bifrost** is a peer-to-peer communications engine with pluggable transports:\n\n- **Cross-platform**: supports web browsers, servers, desktop, mobile, ...\n- **Efficient**: multiplex many simultaneous streams over a single Link.\n- **Encryption**: identify, authenticate, and encrypt each Link between peers.\n- **Flexible**: use multiple transports, protocols, simultaneously.\n- **Meshing**: supports multi-hop routing to a desired target peer w/ circuits.\n- **PubSub**: publish/subscribe channels with pluggable implementations.\n- **Robust**: uses Quic for lossless links over lossy transports.\n\nBifrost uses [ControllerBus] controllers and directives to send any protocol\nover any transport with extensive and flexible configuration.\n\n[ControllerBus]: https://github.com/aperturerobotics/controllerbus\n\n## Overview\n\n[![Go Reference Widget]][Go Reference] [![Go Report Card Widget]][Go Report Card] [![DeepWiki Widget]][DeepWiki]\n\n[Go Reference]: https://pkg.go.dev/github.com/aperturerobotics/bifrost\n[Go Reference Widget]: https://pkg.go.dev/badge/github.com/aperturerobotics/bifrost.svg\n[Go Report Card Widget]: https://goreportcard.com/badge/github.com/aperturerobotics/bifrost\n[Go Report Card]: https://goreportcard.com/report/github.com/aperturerobotics/bifrost\n[DeepWiki Widget]: https://img.shields.io/badge/DeepWiki-aperturerobotics%2Fbifrost-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==\n[DeepWiki]: https://deepwiki.com/aperturerobotics/bifrost\n\nBifrost is designed around the following core concepts:\n\n- **Peer**: a routable process or device with a keypair.\n- **Transport**: a protocol which can create Links with other peers.\n- **Link**: a connection between two peers over a Transport.\n- **Stream**: channel of data between two Peer with a protocol type.\n- **RPC**: request/reply and bidirectional streaming remote calls.\n- **PubSub**: at-least-once delivery of messages to named topics.\n- **Signaling**: exchanging messages between peers via a relay server.\n\nIntegrates with networking, pubsub, and RPC libraries like [libp2p], [starpc],\nand [pion webrtc].\n\n[libp2p]: https://libp2p.io/\n[starpc]: https://github.com/aperturerobotics/starpc\n[pion webrtc]: https://github.com/pion/webrtc\n\nThe [network simulator], [testbed], and [in-proc transport] can be used to write\nend-to-end tests as Go unit tests. The mock transports use identical code to the\nreal transports, and appear the same to the application code.\n\n[network simulator]: ./sim\n[testbed]: ./testbed\n[in-proc transport]: ./transport/inproc\n\nThe [http] packages provide a http server and a mechanism for attaching http\nhandlers to the controller bus and using them to serve requests. There is also\nan implementation of attaching and looking up http clients on the bus.\n\n[http]: ./http\n\n[EntityGraph] exposes the internal state representation of Bifrost to\nvisualizers and instrumentation via a graph-based inter-connected entity model.\n\n[EntityGraph]: https://github.com/aperturerobotics/entitygraph\n\nConfiguring each component as an independent controller makes it easy to adapt\napplication code to different operating environments and protocols.\n\n## Examples\n\n[![Support Server](https://img.shields.io/discord/803825858599059487.svg?label=Discord\u0026logo=Discord\u0026colorB=7289da\u0026style=for-the-badge)](https://discord.gg/KJutMESRsT)\n\nBifrost can be used as either a Go library or a command-line / daemon.\n\nThe [examples](./examples) directory contains yaml files to configure the\ndaemon, as well as \"toys\" which are self-contained Go program examples.\n\nTo install the CLI and daemon:\n\n```bash\n# Clone the repo and install.\ngit clone https://github.com/aperturerobotics/bifrost\ncd ./bifrost/cmd/bifrost\ngo install -v\n\n# Alternatively:\n# Note: this currently fails on go \u003e= 1.16 due to replace directives.\n# See: https://github.com/golang/go/issues/44840\nGO111MODULE=on go install -v github.com/aperturerobotics/bifrost/cmd/bifrost@master\n```\n\nAccess help by adding the \"-h\" tag or running \"bifrost help.\"\n\nAs a basic example, launch the daemon:\n\n```\nbifrost daemon \\\n  --write-config \\\n  --hold-open-links \\\n  --pubsub floodsub  \\\n  --api-listen :5110 \\\n  --udp-listen :5112\n```\n\nCheck out the [http forwarding example](./examples/http-forwarding) for a complete demo.\n\n### Daemon CLI\n\nThe Bifrost daemon is configured with a YAML ConfigSet and/or via the API.\n\n```\nNAME:\n   bifrost daemon - run a bifrost daemon\n\nOPTIONS:\n   --hold-open-links         if set, hold open links without an inactivity timeout [$BIFROST_HOLD_OPEN_LINKS]\n   --websocket-listen value  if set, will listen on address for websocket connections, ex :5111 [$BIFROST_WS_LISTEN]\n   --udp-listen value        if set, will listen on address for udp connections, ex :5112 [$BIFROST_UDP_LISTEN]\n   --establish-peers value   if set, request establish links to list of peer ids [$BIFROST_ESTABLISH_PEERS]\n   --udp-peers value         list of peer-id@address known UDP peers [$BIFROST_UDP_PEERS]\n   --websocket-peers value   list of peer-id@address known WebSocket peers [$BIFROST_WS_PEERS]\n   --pubsub value            if set, will configure pubsub from options: [floodsub] [$BIFROST_PUBSUB]\n   --config value, -c value  path to configuration yaml file (default: \"bifrost_daemon.yaml\") [$BIFROST_CONFIG]\n   --write-config            write the daemon config file on startup [$BIFROST_WRITE_CONFIG]\n   --node-priv value         path to node private key, will be generated if doesn't exist (default: \"bifrost_daemon.pem\") [$BIFROST_NODE_PRIV]\n   --api-listen value        if set, will listen on address for API connections, ex :5110 (default: none) [$BIFROST_API_LISTEN]\n   --prof-listen value       if set, debug profiler will be hosted on the port, ex :8080 [$BIFROST_PROF_LISTEN]\n```\n\nThese CLI flags are provided for convenience to quickly configure a daemon, and\nthe resulting config can be written to a file with `--write-config` for further\nadjustments to be made. Note, however, that additional controllers are available\nwhich are not yet exposed via these flags.\n\n### Client CLI\n\nMost Bifrost functionality is exposed on the client CLI and RPC API:\n\n- Mount a peer by loading a private key into the daemon.\n- Forward incoming streams with a protocol ID to a multiaddress\n- Proxy incoming connections to a listener to a remote peer\n- Open a stream with a remote peer and a given protocol ID\n- Accept a stream for a local peer with a given protocol ID\n\nThe client CLI has the following help output:\n\n```\nbifrost client command [command options] [arguments...]\n\nCOMMANDS:\n   local-peers           returns local peer info\n   identify              Private key will be loaded with a peer controller\n   subscribe             Subscribe to a pubsub channel with a private key or mounted peer and publish base64 w/ newline delim from stdin.\n   forward               Protocol ID will be forwarded to the target multiaddress\n   accept                Single incoming stream with Protocol ID will be accepted\n   dial                  Single outgoing stream with Protocol ID will be dialed\n   listen                Listen on the multiaddress and forward the connection to a remote stream.\n   controller-bus, cbus  ControllerBus system sub-commands.\n```\n\nWith the above operations, all stream handling and interaction with the network\nis exposed to the API and command line. Some examples:\n\n```sh\n  # Note: you can edit bifrost_daemon.yaml to change settings.\n  # Once the daemon configuration exists, you can now just run:\n  bifrost daemon\n\n  # While the command is executing, the private key will be attached.\n  bifrost client identify --peer-priv priv-key.pem\n\n  # While the command is executing, a forwarding controller will be running.\n  # Protocol ID will be forwarded to the target multiaddress\n  # Handles HandleMountedStream directives by contacting the target.\n  # HTTP can be easily proxied through an encrypted stream this way.\n  bifrost client forward \\\n    --peer-id \u003cagent-id\u003e \\\n    --protocol-id /x/myproto \\\n    --target /ip4/127.0.0.1/tcp/8000\n\n  # While the command is executing, a proxying controller will be running.\n  # Protocol ID will be proxied from the listen multiaddress to the target peer.\n  # Calls OpenStream to build a stream from \u003csource-peer-id\u003e to \u003ctarget-peer-id\u003e.\n  # HTTP can be easily proxied through an encrypted stream this way.\n  bifrost client listen \\\n    --peer-id \u003ctarget-peer-id\u003e \\\n    --from-peer-id \u003csource-peer-id\u003e \\\n    --protocol-id /x/myproto \\\n    --listen /ip4/127.0.0.1/tcp/8001\n\n  # Wait for a stream to be opened to the mounted peer with the protocol ID /x/myproto\n  # Standard output is the incoming data stream, standard input is the outgoing data stream.\n  # Standard error is used for logging.\n  bifrost client accept \\\n    --local-peer-id \u003cpeer-id\u003e \\\n    --protocol-id /x/myproto\n\n  # Establish a stream.\n  # Standard output is the incoming data stream, standard input is the outgoing data stream.\n  # Standard error is used for logging.\n  bifrost client dial \\\n    --peer-id \u003ctarget-peer-id\u003e \\\n    --local-peer-id \u003clocal-peer-id\u003e \\\n    --protocol-id /x/myproto\n```\n\n### YAML Configuration\n\nAn example of a ConfigSet in YAML format for the daemon: `bifrost_daemon.yaml`:\n\n```yaml\n# Start a UDP listener on port 5112.\nmy-udp:\n  id: bifrost/udp\n  config:\n    listenAddr: :5112\n\n# Use the floodsub driver for PubSub.\npubsub:\n  id: bifrost/floodsub\n  config: {}\n```\n\n### Example: forward HTTP traffic between peers\n\nThe following is a basic example of using the CLI to forward encrypted traffic\nbetween a local port and a remote peer port, similar to SSH port forwarding:\n\n```sh\n  # note the peer id in the logs\n  ./bifrost daemon \\\n            --write-config \\\n            --udp-listen :5000 \\\n            --node-priv daemon_node_priv_2.pem \\\n            --websocket-listen \":5111\" \\\n            --prof-listen \":6201\"\n\n  # forward incoming connections to port 8000\n  # example: \"python3 -m http.server 8080\"\n  ./bifrost client forward \\\n            --protocol-id \"test/protocol\" \\\n            --target /ip4/127.0.0.1/tcp/8000\n\n  # replace PEER-ID-HERE with the peer ID from the first daemon.\n  # start a second daemon (in a new shell).\n  ./bifrost daemon \\\n            --udp-listen :5001 \\\n            --udp-peers \"PEER-ID-HERE@127.0.0.1:5000\" \\\n            --api-listen \":5112\"\n\n  # tell it to listen on port 8082 and forward to the other peer.\n  # try browsing to http://localhost:8082\n  ./bifrost client --dial-addr 127.0.0.1:5112 listen \\\n            --peer-id \"PEER-ID-HERE\" \\\n            --protocol-id test/protocol \\\n            --listen /ip4/127.0.0.1/tcp/8002\n```\n\nThis example shows how to run two daemons with information on how to contact\neach other, and then \"tell\" the second daemon to listen on port 8002 and forward\nany incoming connections to the remote peer with the given peer ID.\n\nWhen someone connects to port 8002 the EstablishLinkWithPeer directive is added\nand the UDP transport opens the connection with the peer (on-demand.) The stream\nis then negotiated. The remote daemon uses HandleMountedStream which is handled\nby the \"forwarding\" controller, which forwards the stream to localhost at 8000.\n\n### Simulator and End-to-end Testing\n\n```go\n// g is the graph of peers and LANs.\ng := graph.NewGraph()\n\n// Add two peers to the graph.\np0 := addPeer(t, g)\np1 := addPeer(t, g)\n\n// Connect them together with a LAN.\nlan1 := graph.AddLAN(g)\nlan1.AddPeer(g, p0)\nlan1.AddPeer(g, p1)\n\n// Run the simulator\nsim := initSimulator(t, ctx, le, g)\n\n// Test connecting p0 and p1 together!\nsimulate.TestConnectivity(ctx, p0, p1)\n```\n\nThe simulator enables writing end-to-end tests of running controllers on peers\nand validating that everything works with the full Bifrost stack in the loop. It\nuses in-memory pipes to simulate local-area-network connections between peers.\n\nTry the [example end-to-end test](./sim/tests/bifrost/basic_test.go) yourself:\n\n```\ngo test -v -run Basic github.com/aperturerobotics/bifrost/sim/tests/bifrost\n```\n\nYou will see the debug and quic logging followed by the success message:\n\n```\nINFO successful connectivity test: p0 \u003c-\u003e [lan1] \u003c-\u003e p1\n```\n\n## Concepts\n\n### Transports and Links\n\nA Link is a packet stream between two Peer. Links are created by Transports,\nwhich are associated with a local private keypair.\n\nTransports are responsible for handshaking their identity and providing stream\nmultiplexing, encryption, and ordering. The Bifrost codebase contains common\nimplementations for packet-based and stream-based transports, based primarily on\nthe [quic-go] implementation of the Quic UDP protocol.\n\n[quic-go]: https://github.com/quic-go/quic-go\n\nThe HandleMountedStream directive contains incoming protocol and peer info. The\nappropriate controller for the protocol responds to the directive and handles\nthe incoming stream. This decouples the transport layers from the protocols.\n\n### PubSub\n\nA PubSub is a controller that supports topic-based at-least-once delivery.\n\nFloodsub is currently supported as a PubSub protocol.\n\n## Developing\n\nIf using Go only, you don't need `bun` or `Node.JS`.\n\nBifrost uses [Protobuf](https://protobuf.dev/) for message encoding.\n\nYou can re-generate the protobufs after changing any `.proto` file:\n\n```\n# stage the .proto file so bun gen sees it\ngit add .\n# install deps\nbun install\n# generate the protobufs\nbun run gen\n```\n\nTo run the test suite:\n\n```\n# Go tests only\ngo test ./...\n# All tests\nbun run test\n# Lint\nbun run lint\n```\n\n## Support\n\nPlease open a [GitHub issue] with any questions / issues.\n\n[GitHub issue]: https://github.com/aperturerobotics/bifrost/issues/new\n\n... or feel free to reach out on [Matrix Chat] or [Discord].\n\n[Discord]: https://discord.gg/KJutMESRsT\n[Matrix Chat]: https://matrix.to/#/#aperturerobotics:matrix.org\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faperturerobotics%2Fbifrost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faperturerobotics%2Fbifrost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faperturerobotics%2Fbifrost/lists"}