binboi-go is the public Go engine repository for Binboi.
This repository contains the open tunnel, proxy, control-plane, and runtime scaffolding that powers the technical core of the product. The main Binboi dashboard, SaaS workflows, billing flows, and product-specific application code live in a separate private repository.
The goal of this repo is to be easy to read, easy to extend, and comfortable for open-source contributors to navigate.
- A public-facing engine/core repository
- A Go-first codebase for the Binboi runtime
- A place for CLI, daemon, control API, session orchestration, tunnel/proxy scaffolding, and examples
- The Binboi dashboard
- The SaaS product repository
- Billing, marketing, or product-site code
go run ./cmd/binboidThe daemon starts a lightweight control API on :8080 by default.
The daemon also starts a JSON-over-TCP stream control listener on :8081 by default.
go run ./cmd/binboid token create -user user_123The daemon returns the raw token exactly once and stores only its hash in the local token database.
go run ./cmd/binboi auth login -token <raw_token>go run ./cmd/binboi healthgo run ./cmd/binboi http 3000That command connects to the daemon, automatically includes the locally saved auth token in the register handshake, receives tunnel metadata including a random public subdomain, keeps the control connection alive with heartbeat ping/pong messages, can proxy basic HTTP requests and upgraded WebSocket connections back to your local service, automatically retries with session resume when the control connection drops, applies bounded per-stream flow control for safer multiplexing, and contributes per-user usage totals for limits and billing.
go run ./cmd/binboi config init -path ./binboid.jsonbinboi-go is the open engine/core layer.
The private Binboi product repository can depend on this engine, embed it, wrap it, or integrate it as part of the broader hosted experience. Keeping the engine public makes the core runtime easier to audit, document, and contribute to while leaving product-specific concerns separate.
.
├── cmd/ # CLI and daemon entrypoints
├── docs/ # Architecture and supporting docs
├── examples/ # Runnable and deployment-oriented examples
├── internal/ # Internal engine packages
├── pkg/ # Public importable packages
└── scripts/ # Install and developer helper scripts
- The current scaffold implements a working HTTP API, stream control protocol, hashed token-based client auth with in-memory validation cache, random public subdomain assignment, host-based tunnel routing, in-memory usage accounting with periodic flush and plan limits, config loader, logger setup, CLI commands, resumable in-memory session tracking, automatic reconnect, concurrent HTTP request forwarding, upgraded WebSocket tunneling, framed body streaming, and bounded flow control with fair per-stream scheduling.
- The forwarding layer is still intentionally modest: HTTP and WebSocket traffic work over framed streams with backpressure and idle timeouts, but richer flow windows, binary framing, and more advanced protocol adapters are still future work.
- Daemon flow limits live under
control.flow_controlin the JSON config and control active streams, per-stream buffering, stream timeout, and idle timeout behavior. - Client auth settings live under
authin the daemon config and control the token database path, validation cache TTL, andlast_used_atpersistence cadence. - Tunnel routing settings live under
tunnelin the daemon config and control the public host suffix plus the local tunnel registry path used for subdomain uniqueness and tunnel status tracking. - Usage settings live under
usagein the daemon config and control the usage database path, flush cadence, billing window, and simple per-user plan caps for requests, bytes, and active tunnels. - The codebase favors standard library dependencies to keep the engine portable and easy to audit.
- Folder-level README files are included to make each major area understandable on first read.
binboi versionbinboi auth loginbinboi auth logoutbinboi auth showbinboi http 3000binboi healthbinboi config initbinboi config print-samplebinboi session createbinboi session listbinboid token createbinboid token listbinboid token revoke
examples/http-basic: simple upstream HTTP service for local testingexamples/docker-basic: Docker Compose example showing the intended daemon layout
See CONTRIBUTING.md for local development workflow and contribution expectations.
This repository is licensed under the Apache License 2.0. See LICENSE.
Made by Sardor Azimov