https://github.com/ekzhang/bore Skip to content Sign up * Product + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ekzhang / bore Public * Notifications * Fork 9 * Star 353 bore is a simple CLI tool for making tunnels to localhost bore.pub MIT License 353 stars 9 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Security * Insights More * Code * Issues * Pull requests * Actions * Security * Insights This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 4 tags Code Latest commit @ekzhang ekzhang Bump version to 0.2.1 ... b0bfd52 Apr 9, 2022 Bump version to 0.2.1 b0bfd52 Git stats * 18 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Enable CI for all branches Apr 7, 2022 src Improve stability by exiting immediately on common errors (#2) Apr 8, 2022 tests Add integration tests for auth and end-to-end proxying (#4) Apr 9, 2022 .gitignore Fix some packing and documentation things Apr 4, 2022 Cargo.lock Bump version to 0.2.1 Apr 9, 2022 Cargo.toml Bump version to 0.2.1 Apr 9, 2022 LICENSE Add LICENSE (#3) Apr 8, 2022 README.md Bump version to 0.2.1 Apr 9, 2022 View code bore Detailed Usage Local Forwarding Self-Hosting Protocol Authentication Acknowledgements README.md bore Build status Crates.io 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. Video demo # Installation (requires Rust) cargo install bore-cli # 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:, 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.) Detailed Usage This section describes detailed usage for the bore CLI command. Local Forwarding You can forward a port on your local machine by using the bore local command. This takes a positional argument, the local port to forward, as well as a mandatory --to option, which specifies the address of the remote server. bore local 5000 --to bore.pub You can optionally pass in a --port option to pick a specific port on the remote to expose, although the command will fail if this port is not available. The full options are shown below. bore-local 0.2.1 Starts a local proxy to the remote server USAGE: bore local [OPTIONS] --to ARGS: The local port to listen on OPTIONS: -h, --help Print help information -p, --port Optional port on the remote server to select [default: 0] -s, --secret Optional secret for authentication -t, --to Address of the remote server to expose local ports to -V, --version Print version information Self-Hosting As mentioned in the startup instructions, there is an public instance of the bore server running at bore.pub. However, if you want to self-host bore on your own network, you can do so with the following command: bore server That's all it takes! After the server starts running at a given address, you can then update the bore local command with option --to
to forward a local port to this remote server. The full options for the bore server command are shown below. bore-server 0.2.1 Runs the remote proxy server USAGE: bore server [OPTIONS] OPTIONS: -h, --help Print help information --min-port Minimum TCP port number to accept [default: 1024] -s, --secret Optional secret for authentication -V, --version Print version information Protocol 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 acknowledgement 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. Authentication 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.) # on the server bore server --secret my_secret_string # on the client bore local --to --secret my_secret_string Acknowledgements Created by Eric Zhang (@ekzhang1). Licensed under the MIT license. The author would like to thank the contributors and maintainers of the Tokio project for making it possible to write ergonomic and efficient network services in Rust. About bore is a simple CLI tool for making tunnels to localhost bore.pub Topics rust cli tunnel networking tcp proxy self-hosted localhost Resources Readme License MIT License Stars 353 stars Watchers 4 watching Forks 9 forks Releases 2 v0.2.1 Latest Apr 9, 2022 + 1 release Contributors 3 * * * Languages * Rust 100.0% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.