agussarwono.com
image

Bore: The Open-Source Tool for Effortless Localhost Tunneling

· Agus Sarwono

Introduction

In this article, we will learn how to expose your local development using bore as ngrok open source alternative

Sometimes, when we do local development, we might need to expose our local development URL to the public. For example, we might need to test and access it from a mobile device. Instead of using an IP address, we can use the URL generated by tools like ngrok or localtunnel.

To put it simply we need a tool to create a secure tunnel to our localhost from the internet, providing us with a unique or predefined public url that we can use to access our local development environment. This is especially useful when we want to test our application using mobile devices or share our application without deploying to a live server

In this module we will use bore to achieve that

What is bore

bore is a Reverse HTTP/TCP proxy tunnel designed to leverage secure SSH connections from creating secure tunnel to your localhost. By establishing these secure tunnel, bore enables users to access their local servers from the internet. This is achieved through a unique URL generated by the bore client. which can be shared with others or used for personal remote access

Prerequisites

  1. Bore

Step 1: Install bore client

  1. Download bore

  2. Copy bore to your application directory

    • Once downloaded, copy the bore executable to your application directory. For example you can copy it to /url/local/bin using the following command
    sudo cp bore /usr/local/bin
    
  3. Make bore executable

    • Ensure that the bore executable has the proper permissions by making it executable using the following command
    sudo chmod +x /usr/local/bin/bore
    

By following these steps, you’ll have bore installed and ready to use, allowing you to create secure tunnels to access your local servers from the internet

Step 3: Usage

  1. Run your application

    • Start your application using your preferred port, for example, if your application run on the port 3000, you can start it normally it as you normally would.
  2. Run bore client

    • Use bore client to create a secure tunnel, run the following command to establised the tunnel
    bore -s bore.digital -p 2200 -ls localhost -lp 3000
    
    • Here’s a breakdown of the command
      • -s bore.digital : Specifies the bore server you are connecting to
      • -p 2200 : Specifies the port onn the bore server to use for SSH connection
      • -ls localhost : Specifies the local server address
      • -lp 3000 : Specifies the local server port number

By running this command, Bore will create a secure tunnel from your localhost to the internet, allowing external access to your local servers

Conclusion

By setting up bore, you can easily create a secure tunnel to your localhost, enabling internet access to your local application, this helps you test and share your local server without the needing to delpoy it to a live server.

Tumblr
Pinterest