Article directory
What is ngrok?
ngrok is a reverse proxy written in go language, which establishes a secure channel between a common endpoint and a locally running Web server. ngrok can capture and analyze traffic on all channels for later analysis and replay.
support system
- Windows
- Linux
- Mac
- FreeBSD
Start using
1. Download
2. Decompress and install
Unzip < download save path > / ngrok.zip
3. Create an ngrok account and configure authtoken
Because the use of ngrok requires the generation of mapped dynamic domain names, the official website uses the form of users to control and track, so you need to register an account and use it through credentials.
# Keep your credentials $ ./ngrok authtoken <authtoken>
4. Start penetrating the Intranet
# Mapping HTTP 80 Port for Testing $ ./ngrok http 80 ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Account Evan (Plan: Free) Version 2.3.25 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding http://bee9c9ff.ngrok.io -> http://localhost:80 Forwarding https://bee9c9ff.ngrok.io -> http://localhost:80 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
It has been successfully launched. You can visit your site directly by visiting the external network: http://bee9c9ff.ngrok.io or https https://bee9c9ff.ngrok.io.
Or if you want to penetrate a port, such as TCP, you can use it this way.
# Mapping TCP 9000 Port for Testing $ ./ngrok tcp 9000 ngrok by @inconshreveable (Ctrl+C to quit) Session Status online Account Evan (Plan: Free) Version 2.3.25 Region United States (us) Web Interface http://127.0.0.1:4040 Forwarding tcp://0.tcp.ngrok.io:19993 -> localhost:9000 Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00
Use help
NAME: ngrok - tunnel local ports to public URLs and inspect traffic DESCRIPTION: ngrok exposes local networked services behinds NATs and firewalls to the public internet over a secure tunnel. Share local websites, build/test webhook consumers and self-host personal services. Detailed help for each command is available with 'ngrok help <command>'. Open http://localhost:4040 for ngrok's web interface to inspect traffic. EXAMPLES: ngrok http 80 # secure public URL for port 80 web server ngrok http -subdomain=baz 8080 # port 8080 available at baz.ngrok.io ngrok http foo.dev:80 # tunnel to host:port instead of localhost ngrok tcp 22 # tunnel arbitrary TCP traffic to port 22 ngrok tls -hostname=foo.com 443 # TLS traffic for foo.com to port 443 ngrok start foo bar baz # start tunnels from the configuration file VERSION: 2.3.25 AUTHOR: inconshreveable - <alan@ngrok.com> COMMANDS: authtoken save authtoken to configuration file credits prints author and licensing information http start an HTTP tunnel start start tunnels by name from the configuration file tcp start a TCP tunnel tls start a TLS tunnel update update ngrok to the latest version version print the version string help Shows a list of commands or help for one command
Follow-up
- Build Private Server