Closed sepiisagun closed 1 year ago
You can't start 2 tunnels with free ngrok account. You either have to get a paid subscription or create a new account to create another tunnel. If you have a paid subscription then you are ready to go, you dont have to do anything else and just run the script twice. If you are going to create 2 different account then you have to edit the script a little bit. You should change the ngrok command part of the script like this:
- ngrok tcp 127.0.0.1:$NGROK_TCP_PORT > /dev/null &
+ ngrok tcp --authtoken <first_account_token> 127.0.0.1:SERVER_PORT_1 > /dev/null &
+ ngrok tcp --authtoken <second_account_token> 127.0.0.1:SERVER_PORT_2 > /dev/null &
Let me know the output when you try these :)
I actually know that you can run multiple service in a free ngrok account, which can also be found here. I just don't have a good grasp of shell script making. lol. Anyway, thank you for the suggestion!
So closing this as solved!
Would it be possible if this can handle two servers? I was hoping I can run another instance of the shell, but since ngrok can only run 1 service if the default ngrok run script is used, I can't make it work.