Updated: 23 February 2024
For a working web application listening on http://localhost:8080
ngrok http http://localhost:8080
For a MySQL server published to port 3307
ngrok tcp 3307
Locate the ngrok config file
$ ngrok config check
Valid configuration file at ~/snap/ngrok/133/.config/ngrok/ngrok.yml
Configure two tunnels to start from the same agent. Start both with ngrok start client_demo
and ngrok start client_demo_mysql
tunnels:
client_demo:
proto: http
addr: 80
inspect: true
client_demo_mysql:
proto: tcp
addr: 3307
inspect: false
Check a ngrok tcp tunnel
telnet 5.tcp.eu.ngrok.io 16456
Connect to MySQL database made available through ngrok tunnel
mysql -h 5.tcp.eu.ngrok.io -P 16020 -u username -puser_pass db_name