bore v0.4 releases: modern, simple TCP tunnel in Rust
A modern, simple TCP tunnel in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls. That’s all it does: no more and no less.
# On your local machine
bore local 8000 –to bore.pub
This will expose your local port at localhost:8000 to the public internet at bore.pub:<PORT>, where the port number is assigned randomly.
Similar to localtunnel and ngrok, except bore is intended to be a highly efficient, unopinionated tool for forwarding TCP traffic that is simple to install and easy to self-host, with no frills attached.
(bore totals less than 400 lines of safe, async Rust code and is trivial to set up — just run a single binary for the client and server.)
There is an implicit control port at 7835, used for creating new connections on demand. At initialization, the client sends a “Hello” message to the server on the TCP control port, asking to proxy a selected remote port. The server then responds with an acknowledgment and begins listening for external TCP connections.
Whenever the server obtains a connection on the remote port, it generates a secure UUID for that connection and sends it back to the client. The client then opens a separate TCP stream to the server and sends an “Accept” message containing the UUID on that stream. The server then proxies the two connections between each other.
For correctness reasons and to avoid memory leaks, incoming connections are only stored by the server for up to 10 seconds before being discarded if the client does not accept them.
On a custom deployment of bore server, you can optionally require a secret to prevent the server from being used by others. The protocol requires clients to verify possession of the secret on each TCP connection by answering random challenges in the form of HMAC codes. (This secret is only used for the initial handshake, and no further traffic is encrypted by default.)
This release of
bore finally distributes the CLI via prebuilt binaries! If you scroll down to the “Assets” attached to the release, you can now download
bore and install instantly it by just adding a single file to your PATH. No need to build from source using Rust (
cargo install) anymore. Big thanks to @praveenperera for making this happen.
Copyright (c) 2022 Eric Zhang