barbarbar338 / ncfs

🧩 Local game server NGROK to Cloudflare forward script. Make your local server accessible by everyone with your custom domain!
https://hub.docker.com/repository/docker/barbarbar338/ncfs/general
GNU General Public License v3.0
49 stars 6 forks source link

Multiple instances? #2

Closed sepiisagun closed 1 year ago

sepiisagun commented 1 year ago

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.

barbarbar338 commented 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 :)

sepiisagun commented 1 year ago

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!

barbarbar338 commented 1 year ago

So closing this as solved!