{"id":16601480,"url":"https://github.com/yonle/bostr","last_synced_at":"2025-04-28T15:54:06.035Z","repository":{"id":204344420,"uuid":"711621454","full_name":"Yonle/bostr","owner":"Yonle","description":"A nostr relay bouncer","archived":false,"fork":false,"pushed_at":"2025-01-06T15:45:40.000Z","size":377,"stargazers_count":98,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T15:53:43.377Z","etag":null,"topics":["bouncer","multiplexer","nostr","proxy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yonle.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":"2023-10-29T20:15:19.000Z","updated_at":"2025-02-26T23:53:18.000Z","dependencies_parsed_at":"2024-02-03T06:30:23.466Z","dependency_job_id":"55fe5e2c-0959-4b9d-93ea-01169d03e478","html_url":"https://github.com/Yonle/bostr","commit_stats":null,"previous_names":["yonle/bostr"],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yonle%2Fbostr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yonle%2Fbostr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yonle%2Fbostr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yonle%2Fbostr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yonle","download_url":"https://codeload.github.com/Yonle/bostr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251342718,"owners_count":21574243,"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":["bouncer","multiplexer","nostr","proxy"],"created_at":"2024-10-12T00:18:19.230Z","updated_at":"2025-04-28T15:54:06.022Z","avatar_url":"https://github.com/Yonle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bostr\nA nostr relay bouncer.\n\n## What is this?\n**Bostr** is an nostr relay aggregator **proxy** that acts like a regular nostr relay. It connects to multiple configured relays to exchange data (events). This project purpose is saving mobile user's bandwidth when using nostr.\n\n## Why?\nNostr relays is a bunch of dummy servers that store user events. Normally nostr clients connects to more than 5-10 relays to receive and transmit events.\n\nDue to it's nature that connects to more than just a single relay, It's transmitting and retrieving the same event across relays over and over, Which then makes the **client bandwidth usage to be high.** And because of this, Nostr bandwidth usage is not really recommended for some users, notably **mobile data users.**\n\nThis project solve the problem by **proxying** multiple relays in a single socket while **not forwarding the same event** to the client.\n\n## How it works?\n![How it works](img/how_it_works.png)\n\nIn order to make this work properly, A nostr client should only connect to a single bostr relay.\n\n## Installation\n- [NodeJS](https://nodejs.org) (v20 or up) or [Bun runtime](https://bun.sh)\n- A working reverse proxy like [nginx](https://nginx.org) or [caddy](https://caddyserver.com)\n- A fast internet connection\n\nYou could set up an bostr bouncer by installing [Bostr CLI](#bostr-cli), or setting up via [The Source Code](#source-code), or via [Docker](#docker).\n\n**Tip:** When dependencies installation is failed due to failed compilation of `bufferutil` or `utf-8-validate` packages, Run `npm install` with `--omit=optional` (Example: `npm install --omit=optional -g bostr`).\n\nInstallation Methods\n- [Bostr CLI](#bostr-cli)\n- [Source code](#source-code)\n- [Docker](#docker)\n- [Bun runtime](#bun-runtime)\n\n### Bostr CLI\nInstall bostr via `npm`:\n```\nnpm install -g bostr\n```\n\nor via git:\n\n```\nnpm install -g https://codeberg.org/Yonle/bostr.git\n```\n\nYou will need to make config with the following command:\n```\nbostr makeconf bostr_config.js\n```\n\nEdit `bostr_config.js` (Could be modified) with your file editor and fill some required fields accordingly to your needs. You could run it for everyone or only for yourself.\n\n#### Running\nAfter you finished editing the config file, You could start bostr with the following command:\n```\nbostr start bostr_config.js\n```\n\nOr run in background with `tmux`:\n\n```\ntmux new -d \"bostr start bostr_config.js\"\n```\n\nWhen configuring reverse proxy, Ensure that `x-forwarded-proto` header was set as `https`.\n\n### Source code\n\n```\ngit clone -b stable https://codeberg.org/Yonle/bostr\ncd bostr\nnpm install\n```\n\nRename `config.js.example` as `config.js`, Start editing the file and fill some required fields accordingly to your needs. You could run it for everyone or only for yourself.\n\n#### Running\n```\nnode index.js\n```\n\nOr run in background with `tmux`:\n\n```\ntmux new -d \"node index.js\"\n```\n\nWhen configuring reverse proxy, Ensure that `x-forwarded-proto` header was set as `https`.\n\n### Docker\n```\ngit clone https://codeberg.org/Yonle/bostr\ncd bostr\ncp config.js.example config.js\n```\n\nYou will need to edit `config.js` before running the bouncer.\n\nThen, you will need to edit `compose.yaml` to override the forwarded port to match with the one in `config.js`.\n\n#### Running\n```\ndocker build -t bostr:local .\ndocker run --rm --name bostr -p 8080:8080 -v ./config.js:/usr/src/app/config.js bostr:local\n```\n\n### Bun runtime\n```\ngit clone -b stable https://codeberg.org/Yonle/bostr\ncd bostr\nbun install\n```\n\nRename `config.js.example` as `config.js`, Start editing the file and fill some required fields accordingly to your needs. You could run it for everyone or only for yourself.\n\n#### Running\n```\nbun run index.js\n```\n\nOr run in background with `tmux`:\n\n```\ntmux new -d \"bun run index.js\"\n```\n\nWhen configuring reverse proxy, Ensure that `x-forwarded-proto` header was set as `https`.\n\n## Environment Variables\nYou could specify the following environment variables to override the current settings:\n\n- `CLUSTERS` - Run Bostr with specified numbers of clusters.\n- `LOG_ABOUT_RELAYS` - Whenever to log about relay connections.\n\n## License\n\nCopyright 2024 Yonle \u003cyonle@lecturify.net\u003e\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonle%2Fbostr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyonle%2Fbostr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonle%2Fbostr/lists"}