Ngrok Always On?
-
Hello,
Is there any way to have ngrok automatically turn on after starting the computer? It looks like you have to start it up each time.
I'd like to use Laragon as my local intranet server for other computers to access and I'm looking for a url they can use.
Seems like the Other option is to modify each computer's hosts file and add the domain and ip address to each computer's hosts file.
Thanks.
-
@kjshah : Modifying hosts file will work. Another better solution is paying Ngork a monthly fee to have a reserved domain.
Ref: https://ngrok.com/product
-
if I pay the monthly fee to ngrok, how would I autostart ngrok through laragon?
or would I install ngrok separately and configure it specifically for the purchased version?
thanks!
-
@kjshah: You don't need to install ngrok seperately. When you purchase, you'll have a reserved url: myproj.ngrok.io
With reserved url, add it to Laragon is much easier - you just open the Virtual Host file (**Menu > Nginx > sites-enabled > xxx.dev.conf)server_name my-name.dev *.myproj.dev myproj.ngrok.io;
Reload nginx.
Auto trigger Ngrok:
If you use Laragon 3.0, Take a look atProcfile
andautorun
setting:
https://forum.laragon.org/topic/476/laragon-feature-procfile-what-is-it
Here's how:- Open Menu > Procfile > Configuration
- Add this:
Auto Open Ngrok: ngrok http -subdomain=myproj myproj.dev:80 autorun
Now, on Menu > Procfile, you'll have a new menu item: Menu > Procfile > Auto Open Ngrok
When Laragon starts, it will run the commandngrok http -subdomain=myproj myproj.dev:80
, your users can access through myproj.ngrok.io (from the Internet, not only local intranet)
-
@kjshah
Another Note:
If you just use for your local intranet, another way is using xip.io
Here's how:- On Laragon's title, the is an IP - it's the IP of the Server. Assume it is X.X.X.X, you just add it to your Virtual Host
server_name myproj.dev *.myproj.dev myproj.X.X.X.X.xip.io;
- Reload Nginx
Now you users can access your proj by using:
http://myproj.X.X.X.X.xip.io
-
thanks for all the advice. i tried xip.io and it worked great.
one other option I just found is to set it at the router level if you router allows. I have a peplink that I can configure in the custom dns record section as well.