1 min read

Tunnel to Localhost with Bore: Rust-Powered

Bore is presented as an alternative to localtunnel and ngrok. It is crafted in Rust, utilizing tokio as its dependency.

Installation options include using cargo, downloading prebuilt binaries from the release page, or my preferred method, utilizing Docker.

docker run -it --init --rm --network host ekzhang/bore <ARGS>

Client

Expose your localhost on a specific port and obtain a random port from bore.pub with the following command:

docker run -it --init --rm --network host ekzhang/bore local 4321 --to bore.pub
INFO bore_cli::client: connected to server remote_port=64869
INFO bore_cli::client: listening at bore.pub:64869

Alternatively, you can specify a port using the --port option, except it will fail if the port is not available.

Server

For self-hosting the service you can using the same image.

docker run -it --init --rm --network host ekzhang/bore server
INFO bore_cli::server: server listening addr=0.0.0.0:7835

Then simply change the --to value to your domain from the client-side.

It’s important to note that Bore doesn’t retain the original Host header. If you are tunneling a localhost service with a custom domain, such as mysite.localhost, there may be compatibility issues.

For more in-depth information, please visit their github.