You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I've built a gem for localtunnel (an ngrok alternative), using your gem as inspiration. So thanks!
Looking at your code, one thing I noticed is that there is a potential problem with the Ngrok::Tunnel.running? method. If something else (other than Ngrok::Tunnel.stop) kills the tunnel's process, Ngrok::Tunnel.running? will continue to return true, because the @status attribute is stale. To fix this, Ngrok::Tunnel.running? could check whether the process is actually alive via Process.waitpid. Here's an example from my gem: link.
Also, I think it may be a good idea for Ngrok::Tunnel.stop? to wait until the process is completely destroyed after calling Process.kill, since it can take a few moments. Again, here's an example from my gem: link.
The text was updated successfully, but these errors were encountered:
Hi. I've built a gem for localtunnel (an ngrok alternative), using your gem as inspiration. So thanks!
Looking at your code, one thing I noticed is that there is a potential problem with the
Ngrok::Tunnel.running?
method. If something else (other thanNgrok::Tunnel.stop
) kills the tunnel's process,Ngrok::Tunnel.running?
will continue to return true, because the@status
attribute is stale. To fix this,Ngrok::Tunnel.running?
could check whether the process is actually alive viaProcess.waitpid
. Here's an example from my gem: link.Also, I think it may be a good idea for
Ngrok::Tunnel.stop?
to wait until the process is completely destroyed after callingProcess.kill
, since it can take a few moments. Again, here's an example from my gem: link.The text was updated successfully, but these errors were encountered: