Suppose you have created a website in a local server, and your client wants to get access to the website. What would you do then? You have two choices- either you can host the website online or you can take screenshots of every page and sent them to the client. Both ways are a little tough. So, here comes the use of the local tunnel.
It is an amazing solution and makes your local web server available online. So, if you have a lot of files that you need access to, it can be a good choice to reduce your hardship. Moreover, it also enables the users to share a web server on the local development machine without interfering with the firewall or DNS settings.
Also Read: How to Get Started With Web Development
Web Server Accessible Online with Localtunnel
Localtunnel is a CLI tool that enables you to share a web server on your local web development machine. The command of Localtunnel is written in Ruby and it uses the SSH library. It will provide a URL that is easily accessible to the public. Thus, they can access your local webserver from anywhere. In this article, we have discussed how to make your web server accessible online with Localtunnel. So, here we go:
If you want to install Localtunnel on the local development server, you first need to install Node.JS. Once you are done, you need to run the flowing command to install Localtunnel.
npm install -g localtunnel
Now that you have installed Localtunnel globally, you can access it from anywhere. If it is installed, you can use the “lt command”. Now type the following command in command prompt.
It the Localtunnel is installed, the command will return the version of installed Localtunnel.
For running a local server on Mac and Windows, you can use localtunnel MAMP or WAMP. Assume that, your local system runs on port 8000. Now run the following command.
lt --port 8000
The above command will enable the Localtunnel to generate a randomized URL. This will help you to access your local server from anywhere. Moreover, you can customize the local tunnel. If you find it difficult to remember the subdomain, you can change it. You can do it by adding the subdomain parameter following the port number.0.
If you need any kind of help you can run the following command
This command will open up the options and will guide you to use Localtunnel. Hope. this article will help you to understand how to make the web server accessible online with a Localtunnel.