# bore

> Rust CLI that forwards local TCP ports to a remote server, bypassing NAT firewalls. Includes a self-hostable server and a public instance at bore.pub.

Stars: 11.6k · Language: Rust · License: MIT · Categories: Network

- Repository: https://github.com/ekzhang/bore
- Website: http://bore.pub
- Page: https://www.trmn.sh/tools/bore

## Install

- Homebrew: `brew install bore-cli`
- Cargo: `cargo install bore-cli`

## Overview

bore is a TCP tunneling tool written in Rust. It exposes a port on your local machine through a remote server, bypassing NAT firewalls. Running `bore local 8000 --to bore.pub` makes localhost:8000 reachable at `bore.pub:<PORT>`, with the remote port assigned randomly unless you pick one with `--port`. It is comparable to localtunnel and ngrok, but it only forwards raw TCP traffic. The README puts the codebase at about 400 lines of async Rust, built on Tokio.

The same binary has two subcommands. `bore local` is the client. It takes the local port, a required `--to` server address, and optional `--local-host` to expose a host on your LAN other than localhost, `--port` and `--secret`. `bore server` runs your own relay. It accepts `--min-port` and `--max-port` to limit assignable ports, `--bind-addr`, and `--bind-tunnels`, so the control server and the tunnel listeners can bind to different IP addresses. Options can also be set through the environment variables BORE_SERVER, BORE_SECRET, BORE_LOCAL_PORT, BORE_MIN_PORT and BORE_MAX_PORT.

The protocol uses a control port at 7835. The client sends a "Hello" message to request a remote port. For each incoming connection the server generates a UUID and sends it to the client. The client opens a new TCP stream and sends an "Accept" message with that UUID, and the server then proxies the two streams. The server discards connections the client has not accepted within 10 seconds. A self-hosted server can require a shared secret, which clients prove they hold by answering random HMAC challenges. This is only used for the handshake, and tunnel traffic is not encrypted by default.

It is aimed at developers who need to expose a local dev server or other TCP service to the internet, or who want a small relay they can host themselves. The README lists prebuilt binaries for macOS, Windows and Linux, plus Homebrew, AUR, Gentoo, Cargo and Docker packages.

### Installation

```bash
# via Homebrew
brew install bore-cli
```

```bash
# via Cargo
cargo install bore-cli
```

## Alternatives

- [bandwhich](https://www.trmn.sh/tools/bandwhich.md): CLI utility that displays current network utilization by process, connection and remote IP/hostname (Rust, 12.1k stars)
- [oha](https://www.trmn.sh/tools/oha.md): HTTP load generator written in Rust that sends requests to a web application and shows live results in a terminal UI, inspired by rakyll/hey. (Rust, 10.7k stars)
- [gping](https://www.trmn.sh/tools/gping.md): Ping utility with real-time graphical display of response times and command execution times (Rust, 12.7k stars)
- [websocat](https://www.trmn.sh/tools/websocat.md): Command-line WebSocket client and server, like netcat, curl and socat for ws:// and wss://, with TCP/UNIX socket proxying and program execution. (Rust, 8.8k stars)
- [xh](https://www.trmn.sh/tools/xh.md): HTTP client that reimplements HTTPie's syntax with focus on improved performance and speed. (Rust, 8.2k stars)

---

Canonical: https://www.trmn.sh/tools/bore
