• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Ngrok how to share localhost to world

by admin

Often there is a need to open your computer for access via the Internet, for all comers or with a password. For example, if you want to demonstrate a new code, publish files, or simply record all network traffic for research purposes.

To do this, you need to install a web server and direct traffic to it through a third-party server via the reverse SSH tunnel using a program like LocalTunnel or ProxyLocal.

$ gem install localtunnel
$ localtunnel -k ~/.ssh/id_rsa.pub 8080

After that, your computer will be accessible from an address like http://8bv2.localtunnel.com. We launch the program – and localhost online.

$ localtunnel 8080

Recently, a new free service has appeared that does the same thing, but works more stable and has more functionality. Therefore, it is probably worthy of mention: ngrok.com.

The program is distributed in binaries for Linux, Mac OS X, and Windows and works immediately “out of the box” even without registration. But if you register, then there are a couple of additional features.

1. Using SSL:

curl https://myapp.ngrok.com

2. Password protection:

ngrok -httpauth "user:password" 8080

3. Subdomains to choose from, reserved for the future:

ngrok -subdomain myapp 8080

4. Tunnel TCP and UDP:

ngrok -proto tcp 8080

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  2. Understanding the /etc/exports File
  3. How To Create A SSH Banner in CentOS/RHEL Server
  4. How to make a LED flash with the Raspberry Pi
  5. How to change the NIC device name in CentOS / RHEL 6
  6. How to Change Password Of An LXC Container User Account
  7. How to blacklist a local disk using the “find_multipaths” directive in CentOS/RHEL 6
  8. balooctl: command not found
  9. mdadm Command Examples in Linux
  10. powerstat: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright