java-ngrok is a Java wrapper for ngrok that manages its own binary, making ngrok available via a convenient Java API. ngrok is a reverse proxy tool that opens secure tunnels from public URLs to localhost, perfect for exposing local web servers, building webhook integrations, enabling SSH access, testing chatbots, demoing from your own machine, and more, and its made even more powerful with native Java integration through java-ngrok.

Installation

java-ngrok is available on Maven Central.

Maven

<dependency>
    <groupId>com.github.alexdlaird</groupId>
    <artifactId>java-ngrok</artifactId>
    <version>1.5.2</version>
</dependency>

Gradle

implementation "com.github.alexdlaird:java-ngrok:1.5.2"
If we want ngrok to be available from the command line, pyngrok can be installed using pip to manage that for us.

Getting Started

To get started using java-ngrok, see the docs for the NgrokClient.

Integration Examples

java-ngrok is useful in any number of integrations, for instance to test locally without having to deploy or configure. Here are some common usage examples.

Java 8

Java 8 support is not actively maintained, but a compatible build of this project does exist for Java 8. To use it, include the java8-ngrok dependency from Maven Central instead.
<dependency>
    <groupId>com.github.alexdlaird</groupId>
    <artifactId>java8-ngrok</artifactId>
    <version>1.4.2</version>
</dependency>
The Process API was introduced in Java 9, so certain convenience methods around managing the ngrok process (for instance, tearing it down) are not available in the Java 8 build.
Packages 
Package Description
com.github.alexdlaird.exception
This package contains exceptions that can be thrown by java-ngrok.
com.github.alexdlaird.http
This package contains a simple, generic HTTP client, which can be used to interact with ngrok's APIs.
com.github.alexdlaird.ngrok
This package contains functionality related to ngrok.
com.github.alexdlaird.ngrok.conf
This package contains functionality related to java-ngrok configuration.
com.github.alexdlaird.ngrok.installer
This package contains functionality related to downloading and installing ngrok.
com.github.alexdlaird.ngrok.process
This package contains functionality related to managing the ngrok process.
com.github.alexdlaird.ngrok.protocol
This package contains POJOs for interacting with ngrok.
com.github.alexdlaird.util
This package contains utility functions.