Skip to content

Instantly share code, notes, and snippets.

@ejlp12
Last active May 12, 2023 06:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ejlp12/a15300d560b1a6e8600abc885351ea1c to your computer and use it in GitHub Desktop.
Save ejlp12/a15300d560b1a6e8600abc885351ea1c to your computer and use it in GitHub Desktop.
Tunneling, netcat, nc, simple web server for test, ngrok

Create a simple web server for testing

while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; cat index.html; } | nc -l 80; done

Create tunneling so that the web server can be accessible from Internet

Download ngrok from https://ngrok.com/download

Extract the installer file (ZIP) and run following command:

./ngrok 80

If you need a custom domain so you start ngrok http -subdomain=yourcustomdomain 80 , you need to pay.

Otput of the command above:

ngrok by @inconshreveable                                                                                                                                      (Ctrl+C to quit)

Tunnel Status                 online
Version                       2.1.3
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://86776c81.ngrok.io -> localhost:80
Forwarding                    https://86776c81.ngrok.io -> localhost:80

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

Access using browser to http://86776c81.ngrok.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment