@betterportal/tunnels
v1.0.27
Published
HTTP/HTTPS development tunnels using BSB, H3, AnyVali, websocket clients, Prisma, and PostgreSQL 18.
Downloads
2,467
Readme
BetterTunnels
HTTP/HTTPS development tunnels using BSB, H3, AnyVali, websocket clients, Prisma, and PostgreSQL 18.
Dev Setup
npm install
copy .env.example .env
npm run prisma:generate
npm run buildStart PostgreSQL 18 with the included compose file when Docker is available:
docker compose up -d postgres
npm run prisma:migrateRun the server:
npm run devServer startup goes through BSB. Do not start a standalone src/server.ts.
Run a tunnel:
npm run cli -- http 3300Build the release CLI:
cd cli
go build -o ..\dist\btunnel.exe .Notes
- Default domain:
tunnels.betterportal.dev. - Anonymous configured prefixes are ignored.
- Authenticated prefix handling is designed but auth is not in the first runtime slice.
- The H3/WS runtime is owned by the
service-tunnels-proxyBSB plugin. - The release CLI lives in
cli/and builds to single-file Go binaries for Windows, Linux, and macOS.
Docker
Build the BSB runtime image with this plugin preloaded:
docker build -t better-tunnels:dev .Run it with a production DATABASE_URL:
docker run --rm -p 8080:8080 -p 8081:8081 -e DATABASE_URL="postgresql://..." better-tunnels:devSwarm Deploy
On the server, build local images, run migrations, then deploy the stack:
docker swarm init
docker build -t bettertunnels-app:latest .
docker build -t bettertunnels-migrate:latest --target build .
docker build -t bettertunnels-caddy:latest -f Dockerfile.caddy .
docker stack deploy -c docker-stack.yml bettertunnelsapp runs two replicas with start-first rolling updates. Caddy and Postgres are singletons on this one-node swarm. The stack reuses the original Compose volumes by external name.
