'Tunnel not found
I am using ngrok 1 client and server to make a tunnel to localhost.
I run the script to compile ngrokd and ngrok on server side:
NGROK_DOMAIN="my-domain.com"
git clone https://github.com/inconshreveable/ngrok.git
cd ngrok
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=$NGROK_DOMAIN" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000
cp rootCA.pem assets/client/tls/ngrokroot.crt
# make clean
make release-server release-client
I run server:
bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
Then I download just compiled ngrok to the client. I create client config:
NGROK_DOMAIN="my-domain.com"
echo -e "server_addr: $NGROK_DOMAIN:4443\ntrust_host_root_certs: false" > ngrok-config
And run the client:
./ngrok -config=ngrok-config 80
And it shows that it's online:
Tunnel Status online
Version 1.7/1.7
Forwarding http://4f2e0a1e.:8000 -> 127.0.0.1:80
Forwarding https://4f2e0a1e.:8000 -> 127.0.0.1:80
Web Interface 127.0.0.1:4040
# Conn 0
Avg Conn Time 0.00ms
Then I request http://4f2e0a1e.my-domain.com:8000
expecting it to pass request to my localhost:80
:
curl http://4f2e0a1e.my-domain.com:8000
But the response is:
Tunnel 4f2e0a1e.my-domain.com:8000 not found
On the server I see logs right after curl request:
[08:59:15 MSK 2019/02/02] [INFO] (ngrok/log.(*PrefixLogger).Info:83) [pub:1ca51d1c] New connection from myClientIp:63169
[08:59:15 MSK 2019/02/02] [DEBG] (ngrok/log.(*PrefixLogger).Debug:79) [pub:1ca51d1c] Found hostname 4f2e0a1e.my-domain.com:8000 in request
[08:59:15 MSK 2019/02/02] [INFO] (ngrok/log.(*PrefixLogger).Info:83) [pub:1ca51d1c] No tunnel found for hostname 4f2e0a1e.my-domain.com:8000
[08:59:15 MSK 2019/02/02] [DEBG] (ngrok/log.(*PrefixLogger).Debug:79) [pub:1ca51d1c] Closing
Solution 1:[1]
Actually, $NGROK_DOMAIN was empty in line
bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
After I set NGROK_DOMAIN=my-domain.com, it started to work properly.
Solution 2:[2]
I got the final and ultimate solution for this issue !
Solution 3:[3]
You can use VMWare workstation instead of oracle virtual box it will work I m sure. I was also facing the ngrok tunnel error.
Solution 4:[4]
I think this issue is caused by Ngrok firewalls due to suspicious activities.
You have 3 ways of fixing it
Solution #1: Authenticate/Re-authenticate with your token from ngrok How to do that? Steps 1: Go to your ngrok folder location on your terminal Step 2: Enter: ngrok config add-authtoken your_auth_id
Solution #2: Delete your account and recreate it or create an entirely new account on Ngrok. And don't forget to authenticate your token
Solution #3: If your issue is not solved or you keep getting the same error, reach out to Ngrok support team
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Maxim Yefremov |
Solution 2 | Krishnadev P Melevila |
Solution 3 | Deepak Patankar |
Solution 4 | yytambaya |