From e37e76909a5cdfc69c4fa8630c26e21422bd79f1 Mon Sep 17 00:00:00 2001 From: Yonle Date: Sun, 2 Jun 2024 12:23:06 +0700 Subject: [PATCH] README: add instructions to run with bun runtime Signed-off-by: Yonle --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d4e55a..7209197 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,20 @@ This project solve the problem by **proxying** multiple relays in a single socke In order to make this work properly, A nostr client should only connect to a single bostr relay. ## Installation -- [NodeJS](https://nodejs.org) (v18 or up) +- [NodeJS](https://nodejs.org) (v18 or up) or [Bun runtime](https://bun.sh) +- A working reverse proxy like [nginx](https://nginx.org) or [caddy](https://caddyserver.com) - A fast internet connection You 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). **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`). +Installation Methods +- [Bostr CLI](#bostrcli) +- [Source code](#sourcecode) +- [Docker](#docker) +- [Bun runtime](#bunruntime) + ### Bostr CLI Install bostr via `npm`: ``` @@ -97,6 +104,28 @@ docker build -t bostr:local . docker run --rm --name bostr -p 8080:8080 -v ./config.js:/usr/src/app/config.js bostr:local ``` +### Bun runtime +``` +git clone -b stable https://github.com/Yonle/bostr +cd bostr +bun install +``` + +Rename `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. + +#### Running +``` +bun run index.js +``` + +Or run in background with `tmux`: + +``` +tmux new -d "bun run index.js" +``` + +When configuring reverse proxy, Ensure that `x-forwarded-proto` header was set as `https`. + ## Environment Variables You could specify the following environment variables to override the current settings: