Skip to content

Instantly share code, notes, and snippets.

@Fartomy
Created April 5, 2024 12:08
Show Gist options
  • Save Fartomy/f52cbfabe1bc8c75cb7852f0b63044e5 to your computer and use it in GitHub Desktop.
Save Fartomy/f52cbfabe1bc8c75cb7852f0b63044e5 to your computer and use it in GitHub Desktop.
Localhost Accessible

🕯️ Localhost Accessible

You can open the localhost application to the internet with an intermediary (ngrok) and perform tests and experiments.

The procedures in the current step may vary, so it is more reasonable to go to the specified website to access the current steps.
Steps for many platforms are available in the specified link.
This gist is based on Linux.

Setup

  1. You have to Sign Up to that site if you don't before
  2. Install ngrok via Apt with the following command:
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
	| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
	&& echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
	| sudo tee /etc/apt/sources.list.d/ngrok.list \
	&& sudo apt update \
	&& sudo apt install ngrok
  1. Run the following command to add your authtoken to the default ngrok.yml configuration file.
ngrok config add-authtoken <your_auth_token>
  1. For a simple example, start the apache service
systemctl start apache2
  1. Go to the directory where the index files are presented and edit index.html file
cd /var/www/html

Remove the whole lines and added these lines:

<html>
<body>
<center>
<h1>Localhost Accessible</h1>
</center>
</body>
</html>
  1. Make your website accessible
ngrok http http://localhost:80

Source

  1. Access your local computer from anywhere in the world : Hindi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment