setsid ngrok tcp <port> &>/dev/null </dev/null
optional, if you want store the log, enable ngrok option --log=stdout
node -pe 'JSON.parse(process.argv[1])' $(curl -s http://localhost:4040/api/tunnels)
# atau
curl -s http://localhost:4040/api/tunnels | node -pe 'JSON.parse(require("fs").readFileSync("/dev/stdin").toString())'
# atau
curl -s http://localhost:4040/api/tunnels | xargs -0 -I {} node -pe 'JSON.parse(JSON.stringify({}))'
# atau
curl -s http://localhost:4040/api/tunnels | xargs -0 -I {} node -pe 'JSON.parse(process.argv[1])' {}
example ngrok config (ngrok config check
):
version: "2"
authtoken: <redacted>
tunnels:
ssh:
addr: 22
proto: tcp
http:
addr: 80
proto: http
start multiple service with single tunnel:
ngrok start ssh http
get the ngrok configuration: