
exdlaird.java-ngrok.2.2.1.source-code.overview.html Maven / Gradle / Ivy
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>2.2.1</version>
</dependency>
Gradle
implementation "com.github.alexdlaird:java-ngrok:2.2.1"
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 {@link com.github.alexdlaird.ngrok.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.
ngrok
Version Compatibility
java-ngrok
is compatible with ngrok
v2 and v3, but by default it will install v3. To install
v2 instead, set the version with {@link com.github.alexdlaird.ngrok.conf.JavaNgrokConfig.Builder#withNgrokVersion(NgrokVersion)}
and {@link com.github.alexdlaird.ngrok.protocol.CreateTunnel.Builder#withNgrokVersion(NgrokVersion)}, or more simply
use the version of java-ngrok
that defaults to ngrok
v2.
<dependency>
<groupId>com.github.alexdlaird</groupId>
<artifactId>java-ngrok</artifactId>
<version>1.7.2</version>
</dependency>
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.5</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.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy