OpenAICloudflare Developer PlatformMay 18, 2026, 12:00 AM

Workers - Share local dev servers through Cloudflare Tunnel in Wrangler and Vite

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

openaienmodel: gpt-5-mini-2025-08-07

Workers - Share local dev servers through Cloudflare Tunnel in Wrangler and Vite

Key Points

  • Press t in Wrangler to open a tunnel
  • Press t + Enter in the Vite plugin
  • Supports quick random or named tunnels with Access

Summary

You can now expose local development servers through Cloudflare Tunnel directly from Wrangler or the Cloudflare Vite plugin to get a public URL for sharing previews, testing webhooks, or accessing your app from other devices.

Key Points

  • Start a tunnel while your dev server is running: press t in Wrangler, or t then Enter when using the Cloudflare Vite plugin.
  • Two tunnel modes:
    • Quick tunnel: temporary random hostname under *.trycloudflare.com for ad-hoc sharing.
    • Named tunnel: stable hostname and option to restrict access with Cloudflare Access (recommended for persistent previews).
  • Common use cases: previewing work with stakeholders, receiving external webhooks during local development, or testing from remote devices.
  • Practical notes for engineers:
    • Tunnels are initiated interactively from the running dev tooling; ensure your dev server is already listening on the expected port.
    • Use a named tunnel for predictable URLs and access controls; see the “Share a local dev server” docs for named tunnel setup and auth configuration.
    • Quick tunnels are convenient for short-lived demos but are not suitable for long-term or controlled access.

Next steps

  • For a stable setup and Access integration, follow the named tunnel setup in the Cloudflare docs.
  • Try the new flow during local development to validate webhook flows or collect stakeholder feedback quickly.

Full Translation

Translations

A translation section that keeps the flow of the original article.

openaijamodel: gpt-5-mini-2025-08-07

Workers — Wrangler と Vite で Cloudflare Tunnel を使ってローカル開発サーバーを共有

Workers — Wrangler と Vite で Cloudflare Tunnel を使ってローカル開発サーバーを共有

公開日: 2026-05-18

Cloudflare Tunnel を使って、Wrangler または Cloudflare Vite plugin を利用中のローカル開発セッションを共有し、公開 URL を取得できるようになりました。これは、プレビューの共有、Webhook のテスト、別のデバイスからアプリにアクセスする必要がある場合に便利です。

主な利用方法:

  • 一時的な Quick tunnel を開始して、ランダムな *.trycloudflare.com ホスト名を取得する
  • 既存の named tunnel を使用して、安定したホスト名を利用し、Cloudflare Access でアクセスを制限する

使い方:

  • 開発サーバーが実行中に、Wrangler では t を押す、Vite では t + Enter を押すとトンネルが開始されます。

named tunnel の設定方法の詳細については、Share a local dev server を参照してください。

用途の例:

  • チームやクライアントに即時プレビューを共有する
  • 外部サービスからの Webhook をローカル環境で受け取りテストする
  • スマートフォンなど別端末からローカルアプリにアクセスする

注意点:

  • Quick tunnel は一時的なランダムホスト名を提供します。安定したホスト名やアクセス制御が必要な場合は named tunnel と Cloudflare Access の併用を推奨します。

その他のリソース: Cloudflare のドキュメントやダッシュボードでさらに詳細を確認してください。