Comments (22)
As of version 2.0.24, ngrok http 80 --log=stdout > ngrok.log &
did the trick.
from ngrok.
The right command is now
ngrok http 80 --log=stdout > ngrok.log &
from ngrok.
@jfelchner That's good feedback. I think you can get what you want now with:
ngrok -log=stdout 80 > /dev/null &
Or if you want a log:
ngrok -log=stdout 80 > ngrok.log &
This is a very unintuitive UI. "-log=stdout" really means "disable the terminal UI", which is surprising and not well documented.
I've recently discovered that it's possible for a program to detect whether it's attached to a tty or not and adjust its UI accordingly. I'll probably use that in the next version of ngrok to disable the terminal UI when run under supervisors or in the background, as well as possibly splitting out "do I run the terminal ui" into a separate option (or at least configuration file parameter).
With regard to a daemonization: it seems like if the "&" operator works as you expect it to, that it becomes unnecessary to have a daemon option. Do you disagree?
from ngrok.
This worked for me!
ngrok -log=stdout 80 > /dev/null &
from ngrok.
This is stupid, the ngrok team should really have a --daemon flag, because i'm sshing into my Raspberry Pi to run ngrok, except when I shut the terminal, the agent stops, so now I have to have my laptop running when when I'm using my Raspberry Pi with OMV.
from ngrok.
Just wanted to let you know that I've run into the same UX issue and a --quiet or similar flag would have been more obvious.
from ngrok.
it works! now... how can i stop it?
kill -9 "$(pgrep ngrok)"
from ngrok.
I thought I'd replied to this. ngrok does let you supply -log=stdout which will turn off the console interface and just display streaming log output over stdout. There is no daemon mode and I don't intend on adding one. I think daemonizing services is almost always better left to a supervising framework like runit/upstart/supervisor/etc.
from ngrok.
You did, this was posted before your reply. Thanks for the tip.
from ngrok.
@inconshreveable I'd be fine if this solution actually let you run the thing in the background, but running something like:
ngrok -log="$HOME/ngrok.log" 80 &
doesn't even allow you to background the job. It fails with a:
suspended (tty output) ngrok -log="$HOME/ngrok.log" 80
If I have a config file, I need zero output from ngrok on what it's doing 99% of the time. The -log
should disable the "dashboard" screen on what is connected, for how long and on which interfaces. Either that or there should be a -quiet
option which does the equivalent thing.
from ngrok.
@inconshreveable also, I can see where you're coming from regarding "daemonizing", however, you have to consider your tool may be used by those who:
a. cannot understand how those services work (eg, explaining to a non-technical QA person how to set it up)
b. don't need the overhead of a "supervising framework" when all they want to do is run ngrok in the background for a few hours so they can pair with someone
I'm currently trying to work on my shellfiles so they can be used by our developers to abstract away whether they are using localtunnel, ngrok, pagekite, etc. All of the other services offer some sort of "run this thing without any terminal output" except for ngrok. So if I'm to support ngrok, I not only have to know if ngrok is installed, but I also have to check to see which type of "supervising framework" they have installed, figure out whether it's configured to run ngrok, and finally execute the proper command for that framework to start ngrok.
That's a lot of extra work for something that is as simple as "route all output to a log file" and optionally "drop a PID file somewhere".
from ngrok.
@inconshreveable if the &
option works and I can get everything logged to a file, then I don't think a -daemon
option is necessary.
I'll try out your solution above and get back with you.
Thanks for the reply!
from ngrok.
@rwestergren me too. :)
As soon as Github actually gets a "here is a list of all the issues you're subscribed to", stuff like this won't fall through the cracks.
from ngrok.
'scuse my probably stupidity, but how would I get -log=stdout > /dev/null &
to work with ssh forwarding, for example, something like this:
./ngrok -subdomain=foo -authtoken barxyz -proto=tcp 22
I can't figure out where the 'tcp' declaration would go.
from ngrok.
Someone know how to log -proto=tcp 22 ?
from ngrok.
I was successful using a tunnel for ssh in the config file and running
ngrok -log=stdout > /dev/null start ssh &
my config file looks like this
tunnels:
ssh:
remote_port: 50800
proto:
tcp: 22
from ngrok.
When I try ngrok -log=stdout 80 > ~/ngrok.log &
with v2.0.19, the output I get is the command instructions as though I entered an invalid parameter.
from ngrok.
@selfagency same issue here, the -log is the problem, how to achieve the same thing with the new version?
from ngrok.
@gnhuy91 Doesn't this fill up the log file and cause waste of memory? I mean, does log rotation need to be turned on??
from ngrok.
@IgorGanapolsky yea you should bring up your own solution, but anw above command no longer available.
from ngrok.
This solution no longer works (w/ 2.3.35). Incorrect Usage: flag provided but not defined: -log
from ngrok.
it works! now... how can i stop it?
from ngrok.
Related Issues (20)
- ngrok status reconnecting issue failed to send authentication request: read tcp HOT 6
- Ngrok in the termux HOT 2
- React + Express + Socket.io + Ngrok HOT 2
- Not registering server responses HOT 3
- question regarding memory usage HOT 2
- "An SSL error has occurred and a secure connection to the server cannot be made" HOT 1
- ngrok service doesn't reconnect after laptop sleep with ERR_NGROK_334 HOT 3
- Proposal to Fork and Maintain ngrok HOT 4
- There was an issue when use ngrok http http://xxx.xxx.xxx.xxx HOT 1
- Ngrok not working correctly for me HOT 1
- NGROK won't send image if it is embedded in HTML HOT 1
- "no longer signed" error when updating with apt on Ubuntu HOT 2
- NgRok minecraft 1 20 4 server (vanila) HOT 2
- Issue in sending sensor data from ESP8266 to Ngrok tunnel HOT 1
- Successfully create tunnel, not able to connect to it HOT 1
- Threat detected by Windows Security: AndroidOS/ZkarletFlash HOT 1
- Can't connect to gRPC
- Ngrok service start failed on macos HOT 2
- Consider transferring issues to the new repo HOT 3
- Reconnection issue with ngrok while tunneling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngrok.