{"id":15893598,"url":"https://github.com/alexdlaird/java-ngrok","last_synced_at":"2026-04-27T04:02:24.250Z","repository":{"id":37927394,"uuid":"359293310","full_name":"alexdlaird/java-ngrok","owner":"alexdlaird","description":"A Java wrapper for ngrok","archived":false,"fork":false,"pushed_at":"2026-04-23T10:33:06.000Z","size":1863,"stargazers_count":56,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-23T12:23:05.348Z","etag":null,"topics":["education","ingress","java","localhost","ngrok","reverse-proxy","tunnel","tunneling","webhook"],"latest_commit_sha":null,"homepage":"https://alexdlaird.github.io/java-ngrok/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexdlaird.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"alexdlaird","patreon":"alexdlaird","custom":["https://www.paypal.me/alexdlaird"]}},"created_at":"2021-04-19T01:27:12.000Z","updated_at":"2026-04-20T11:33:26.000Z","dependencies_parsed_at":"2024-02-14T00:25:55.566Z","dependency_job_id":"f8eddd36-d67e-4f43-a685-900eaf383ddf","html_url":"https://github.com/alexdlaird/java-ngrok","commit_stats":null,"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"purl":"pkg:github/alexdlaird/java-ngrok","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdlaird%2Fjava-ngrok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdlaird%2Fjava-ngrok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdlaird%2Fjava-ngrok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdlaird%2Fjava-ngrok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexdlaird","download_url":"https://codeload.github.com/alexdlaird/java-ngrok/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexdlaird%2Fjava-ngrok/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32321075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["education","ingress","java","localhost","ngrok","reverse-proxy","tunnel","tunneling","webhook"],"created_at":"2024-10-06T08:12:13.731Z","updated_at":"2026-04-27T04:02:24.245Z","avatar_url":"https://github.com/alexdlaird.png","language":"Java","funding_links":["https://github.com/sponsors/alexdlaird","https://patreon.com/alexdlaird","https://www.paypal.me/alexdlaird"],"categories":["网络编程","Development Tools"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg alt=\"java-ngrok - a Java wrapper for ngrok\" src=\"https://github.com/alexdlaird/java-ngrok/raw/main/logo.png\" /\u003e\u003c/p\u003e\n\n[![Version](https://img.shields.io/maven-central/v/com.github.alexdlaird/java-ngrok)](https://central.sonatype.com/artifact/com.github.alexdlaird/java-ngrok)\n[![Java Versions](https://img.shields.io/badge/Java-11+-blue)](https://central.sonatype.com/artifact/com.github.alexdlaird/java-ngrok)\n[![Coverage](https://img.shields.io/codecov/c/github/alexdlaird/java-ngrok)](https://codecov.io/gh/alexdlaird/java-ngrok)\n[![Build](https://img.shields.io/github/actions/workflow/status/alexdlaird/java-ngrok/build.yml)](https://github.com/alexdlaird/java-ngrok/actions/workflows/build.yml)\n[![Code Quality](https://api.codacy.com/project/badge/Grade/940d16178f8f4e8abfcf9bf2873894b3)](https://app.codacy.com/gh/alexdlaird/java-ngrok?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=alexdlaird/java-ngrok\u0026utm_campaign=Badge_Grade)\n[![Docs](https://img.shields.io/badge/docs-passing-brightgreen)](https://alexdlaird.github.io/java-ngrok/)\n[![GitHub License](https://img.shields.io/github/license/alexdlaird/java-ngrok)](https://github.com/alexdlaird/java-ngrok/blob/main/LICENSE)\n\n`java-ngrok` is a Java wrapper for `ngrok` that manages its own binary, making `ngrok` available via a convenient Java\nAPI.\n\n[`ngrok`](https://ngrok.com) is a reverse proxy that opens secure tunnels from public URLs to localhost. It's perfect\nfor rapid\ndevelopment (test webhooks, demo local websites, enable SSH access), establishing ingress to external\nnetworks and devices, building production APIs (traffic policies, OAuth, load balancing), and more. And\nit's made even more powerful with native Java integration through the `java-ngrok` client.\n\n## Installation\n\n`java-ngrok` is available\non [Maven Central](https://central.sonatype.com/artifact/com.github.alexdlaird/java-ngrok).\n\nIf you want `ngrok` to be available from the command\nline, [`pyngrok`](https://pyngrok.readthedocs.io/en/latest/#installation)\ncan be installed using `pip` to manage that for you.\n\n## Basic Usage\n\n### Open a Tunnel\n\nTo open a tunnel, use the [`NgrokClient`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/NgrokClient.html)'s [`connect()`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/NgrokClient.html#connect(com.github.alexdlaird.ngrok.protocol.CreateTunnel))\nmethod, which returns a [`Tunnel`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/NgrokClient.html#connect(com.github.alexdlaird.ngrok.protocol.CreateTunnel)),\nand this returned object has a reference to the public URL generated by `ngrok`, which can be retrieved with\n[`getPublicUrl()`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/protocol/Tunnel.html#getPublicUrl()).\n\n```java\nfinal NgrokClient ngrokClient = new NgrokClient.Builder().build();\n\n// Open a HTTP tunnel on the default port 80\n// \u003cTunnel: \"https://\u003cpublic_sub\u003e.ngrok.io\" -\u003e \"http://localhost:80\"\u003e\nfinal Tunnel httpTunnel = ngrokClient.connect();\n\n// Open a SSH tunnel\n// \u003cTunnel: \"tcp://0.tcp.ngrok.io:12345\" -\u003e \"localhost:22\"\u003e\nfinal CreateTunnel sshCreateTunnel = new CreateTunnel.Builder()\n        .withProto(Proto.TCP)\n        .withAddr(22)\n        .build();\nfinal Tunnel sshTunnel = ngrokClient.connect(sshCreateTunnel);\n\n// Open a named tunnel from the config file\nfinal CreateTunnel createNamedTunnel = new CreateTunnel.Builder()\n        .withName(\"my-config-file-tunnel\")\n        .build();\nfinal Tunnel namedTunnel = ngrokClient.connect(createNamedTunnel);\n\n// Open an Internal Endpoint that's load balanced\n// \u003cTunnel: \"https://some-endpoint.internal\" -\u003e \"http://localhost:9000\"\u003e\nfinal CreateTunnel createInternalEndpoint = new CreateTunnel.Builder()\n        .withAddr(\"9000\")\n        .withDomain(\"some-endpoint.internal\")\n        .withPoolingEnabled(true)\n        .build();\nfinal Tunnel internalEndpoint = ngrokClient.connect(createInternalEndpoint);\n```\n\nThe [`connect()`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/NgrokClient.html#connect(com.github.alexdlaird.ngrok.protocol.CreateTunnel))\nmethod can also take\na [`CreateTunnel`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/protocol/CreateTunnel.html)\n(which can be built through [its Builder](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/protocol/CreateTunnel.Builder.html))\nthat allows you to pass additional properties that\nare supported by `ngrok` (or [`withName()`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/protocol/CreateTunnel.Builder.html#withName(java.lang.String))\nto use a tunnel defined in `ngrok`'s config\nfile), [as documented here](https://alexdlaird.github.io/java-ngrok/#tunnel-configuration).\n\n\u003e **Note:** `java-ngrok` unifies `ngrok`'s \"tunnel\" (v2) and \"endpoint\" (v3) concepts behind a single API:\n\u003e `connect()` returns a `Tunnel` and handles the differences for you through the `JavaNgrokConfig.configVersion` you\n\u003e set. Existing v2 code keeps working unchanged, and every v2 tunnel and v3 endpoint feature remains available.\n\u003e For v3-specific usage, see [Using v3 Endpoints](https://alexdlaird.github.io/java-ngrok/#using-v3-endpoints).\n\n### `ngrok`'s API\n\nThe [`api()`](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest/com.github.alexdlaird.ngrok/com/github/alexdlaird/ngrok/NgrokClient.html#api(java.util.List)) method allows you to use the local\n`ngrok` agent to make requests against [the `ngrok` API](https://ngrok.com/docs/agent/cli-api/), if you\nhave [set an API key](https://alexdlaird.github.io/java-ngrok/#setting-the-authtoken-or-api_key).\nFor example, here's how you would reserve a `ngrok` domain, then create a Cloud Endpoint with an associated traffic\npolicy:\n\n```java\nfinal NgrokClient ngrokClient = new NgrokClient.Builder().build();\n\nfinal String domain = \"some-domain.ngrok.dev\";\nfinal ApiResponse domainResponse = ngrokClient.api(\n        List.of(\"reserved-domains\", \"create\",\n                \"--domain\", domain));\nfinal ApiResponse endpointResponse = ngrokClient.api(\n        List.of(\"endpoints\", \"create\",\n                \"--bindings\", \"public\",\n                \"--url\", String.format(\"https://%s\", domain),\n                \"--traffic-policy-file\", \"policy.yml\"));\n```\n\n### Command Line Usage\n\nAssuming you have also installed [`pyngrok`](https://pyngrok.readthedocs.io/en/latest/#installation), all features of\n`ngrok` are available\non the command line.\n\n```sh\nngrok http 80\n```\n\nFor details on how to fully leverage `ngrok` from the command line,\nsee [`ngrok`'s official documentation](https://ngrok.com/docs/agent/cli/).\n\n## Documentation\n\nFor more advanced usage, `java-ngrok`'s official documentation is available\n[here on GitHub](https://alexdlaird.github.io/java-ngrok/), with additional API documentation on [javadoc.io](https://javadoc.io/doc/com.github.alexdlaird/java-ngrok/latest).\n\n### Integration Examples\n\n- [Spring](https://alexdlaird.github.io/java-ngrok/integration/#spring)\n- [Dropwizard](https://alexdlaird.github.io/java-ngrok/integration/#dropwizard)\n- [Play (Scala)](https://alexdlaird.github.io/java-ngrok/integration/#play-scala)\n- [Docker](https://alexdlaird.github.io/java-ngrok/integration/#docker)\n- [End-to-End Testing](https://alexdlaird.github.io/java-ngrok/integration/#end-to-end-testing)\n\n### Java 8\n\n[![Version](https://img.shields.io/maven-central/v/com.github.alexdlaird/java8-ngrok)](https://central.sonatype.com/artifact/com.github.alexdlaird/java8-ngrok)\n[![Java Versions](https://img.shields.io/badge/Java-8+-blue)](https://central.sonatype.com/artifact/com.github.alexdlaird/java8-ngrok)\n[![Coverage](https://img.shields.io/codecov/c/github/alexdlaird/java-ngrok/1.4.x)](https://codecov.io/gh/alexdlaird/java-ngrok/tree/1.4.x)\n[![Build](https://img.shields.io/github/actions/workflow/status/alexdlaird/java-ngrok/build.yml?branch=1.4.x)](https://github.com/alexdlaird/java-ngrok/actions/workflows/build.yml?query=branch%3A1.4.x)\n[![Docs](https://img.shields.io/badge/docs-passing-brightgreen)](https://javadoc.io/doc/com.github.alexdlaird/java8-ngrok)\n[![GitHub License](https://img.shields.io/github/license/alexdlaird/java-ngrok)](https://github.com/alexdlaird/java-ngrok/blob/main/LICENSE)\n\nA Java 8-compatible build was previously maintained in the [`1.4.x`](https://github.com/alexdlaird/java-ngrok/tree/1.4.x)\nbranch. While it is no longer supported, it is available through the `java8-ngrok` artifact instead on [Maven Central](https://central.sonatype.com/artifact/com.github.alexdlaird/java8-ngrok).\n\nFor more details on what differs in the `java8-ngrok` dependency,\nsee [the \"Java 8\" section of the docs](https://javadoc.io/static/com.github.alexdlaird/java8-ngrok/1.4.19/overview-summary.html#java8).\n\n## Contributing\n\nIf you would like to get involved, be sure to review\nthe [Contribution Guide](https://github.com/alexdlaird/java-ngrok/blob/main/CONTRIBUTING.md).\n\nWant to contribute financially? If you've found `java-ngrok`\nuseful, [sponsorship](https://github.com/sponsors/alexdlaird)\nwould also be greatly appreciated!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdlaird%2Fjava-ngrok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdlaird%2Fjava-ngrok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdlaird%2Fjava-ngrok/lists"}