How to access localhost application on HTTPS domain for free?

I assume you are a laravel developer. You have developed an awesome application and you want to show it to the client/ friend for testing purpose but here is the catch, application is on localhost :frowning:

What could be a feasible solution to this situation?

  1. Get a domain name and hosting: This is could be a quiet costly solutions.
  2. localhost.run : This is a free service provided by localhost.run. You need not to download and install anything. Yes, tell me more about it.

Follow these steps:

  1. Serve laravel locally i.e php artisan serve. It will serve it on port 8000 if port 8000 is used by other application then serve it on other port, for example, php artisan serve --port 8001

  2. now open another terminal and write this code, ssh -R 80:localhost:<PORT_NUMBER> ssh.localhost.run. where <PORT_NUMBER> can be 8000 or 8001

  3. This command will now generate two urls, one with https and one with non https.
    Example: Connect to http://<COMPUTER_NAME>.localhost.run or https://<COMPUTER_NAME>.localhost.run

  4. In my case, it is https://decodeweb_in.localhost.run

Now you can share this link to anybody in world and access your application as long as the process is not terminated in the terminal. Though loading speed will not be as fast as in localhost but its free, you should try it.

Thank you !