Skip to content

feat(tunneling): implement the ngrok tunnel provider#59

Open
ishanj12 wants to merge 1 commit into
oblien:mainfrom
ishanj12:feat/ngrok-tunnel-provider
Open

feat(tunneling): implement the ngrok tunnel provider#59
ishanj12 wants to merge 1 commit into
oblien:mainfrom
ishanj12:feat/ngrok-tunnel-provider

Conversation

@ishanj12

@ishanj12 ishanj12 commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • Implements the ngrok tunnel provider (was a stub throwing ProviderNotImplementedError), matching the shape of the existing Oblien provider.
  • Uses @ngrok/ngrok (agent SDK) to open/manage the tunnel, and @ngrok/ngrok-api (optional, needs NGROK_API_KEY) to reserve a custom domain when input.slug is given.
  • Free-tier accounts (only NGROK_AUTHTOKEN set) get their auto-assigned dev-domain — create() probe-connects once to learn the hostname, then connect() opens the real long-lived listener against it.
  • TunnelAgent adapter wraps @ngrok/ngrok's Listener (which has no native disconnect/error events, only listener.join()) into the disconnect/close events manager.ts's reconnect-with-backoff expects.

Test plan

  • tsc --noEmit clean across apps/api
  • New unit test suite (apps/api/test/modules/tunneling/ngrok.provider.test.ts, 22 tests, mocked SDKs) covering preflight, both create() paths (with/without API key, no-slug probe path), conflict/ownership disambiguation, delete()'s resource-id gating, and the TunnelAgent adapter's close-vs-drop event distinction
  • Live-tested against a real ngrok pay-as-you-go account: auto-assigned dev-domain tunnel created, connected, and confirmed reachable end-to-end (real HTTP response through the tunnel); reserved custom-domain path created/connected/deleted and verified via the API that only the test reservation was removed, account's existing dev-domain untouched
  • Full existing test suite passes with no new failures (bun run test)

Replaces the ngrok provider stub with a real implementation built on
@ngrok/ngrok (agent) and @ngrok/ngrok-api (reserved domains). Supports
both the free-tier auto-assigned dev-domain and paid custom-domain
reservation, with a TunnelAgent adapter around @ngrok/ngrok's
join()-based lifecycle. Verified against a live ngrok account.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Hydralerne

Copy link
Copy Markdown
Member

which feature needs this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants