This example application starts a hello world HTTP server on port 8085 and then uses the ngrok Java SDK (com.ngrok:ngrok-java) to forward public traffic to that server. See the SDK reference for more details. When you run it, you'll get a public URL that anyone can use to access your app.
git clone git@github.com:ngrok/java-sdk-example.git
cd java-sdk-example
NGROK_AUTHTOKEN=<token> mvn compile exec:javaMIT