Class NgrokProcess
- java.lang.Object
-
- com.github.alexdlaird.ngrok.process.NgrokProcess
-
public class NgrokProcess extends java.lang.ObjectAn object containing information about thengrokprocess.
-
-
Constructor Summary
Constructors Constructor Description NgrokProcess(JavaNgrokConfig javaNgrokConfig, NgrokInstaller ngrokInstaller)Ifngrokis not already installed atJavaNgrokConfig.getNgrokPath(), the givenNgrokInstallerwill install it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetApiUrl()Get the API URL for thengrokweb interface.java.lang.StringgetVersion()Get thengrokversion.booleanisRunning()Check if this object is currently managing a runningngrokprocess.voidsetAuthToken(java.lang.String authToken)Set thengrokauth token in the config file, enabling authenticated features (for instance, more concurrent tunnels, custom subdomains, etc.).voidstart()If not already running, start angrokprocess with no tunnels.voidstop()Terminate thengrokprocesses, if running.voidupdate()Updatengrok, if an update is available.
-
-
-
Constructor Detail
-
NgrokProcess
public NgrokProcess(JavaNgrokConfig javaNgrokConfig, NgrokInstaller ngrokInstaller)
Ifngrokis not already installed atJavaNgrokConfig.getNgrokPath(), the givenNgrokInstallerwill install it. This will also provision a defaultngrokconfig atJavaNgrokConfig.getConfigPath()()}, if none exists.- Parameters:
javaNgrokConfig- Thejava-ngrokto use when interacting with thengrokbinary.ngrokInstaller- The class used to download and installngrok.
-
-
Method Detail
-
start
public void start()
If not already running, start angrokprocess with no tunnels. This will start thengrokweb interface, against which HTTP requests can be made to create, interact with, and destroy tunnels.
-
isRunning
public boolean isRunning()
Check if this object is currently managing a runningngrokprocess.
-
stop
public void stop()
Terminate thengrokprocesses, if running. This method will not block, it will just issue a kill request.
-
setAuthToken
public void setAuthToken(java.lang.String authToken)
Set thengrokauth token in the config file, enabling authenticated features (for instance, more concurrent tunnels, custom subdomains, etc.).- Parameters:
authToken- The auth token.
-
update
public void update()
Updatengrok, if an update is available.
-
getVersion
public java.lang.String getVersion()
Get thengrokversion.- Returns:
- The version.
-
getApiUrl
public java.lang.String getApiUrl()
Get the API URL for thengrokweb interface.
-
-