From 9351330b38bb995348baff15c25d24d521fb9efa Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Mon, 9 Feb 2026 23:51:36 +0000 Subject: [PATCH 1/7] Add docs for wrangler dev + tunnels Co-authored-by: irvinebroque --- .../do-more-with-tunnels/trycloudflare.mdx | 1 + .../development-testing/expose-dev-server.mdx | 204 ++++++++++++++++++ .../workers/development-testing/index.mdx | 2 + .../docs/workers/wrangler/commands.mdx | 2 +- 4 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 src/content/docs/workers/development-testing/expose-dev-server.mdx diff --git a/src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare.mdx b/src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare.mdx index e5dda0a6998..4412964b564 100644 --- a/src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare.mdx +++ b/src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare.mdx @@ -31,6 +31,7 @@ TryCloudflare quick tunnels are currently not supported if a `config.yaml` confi - Create a web server for a project on your laptop that you want to share with others on different networks - Test browser compatibility for a new site by creating a free Tunnel and testing the link in different browsers - Run speed tests from different regions by using a tool like Pingdom or WebPageTest to connect to the randomly-generated subdomain created by TryCloudflare +- Expose a local [Workers dev server](/workers/development-testing/expose-dev-server/) to receive webhooks or share with teammates — for example, `cloudflared tunnel --url http://localhost:8787` ### Why does Cloudflare provide this service for free? diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx new file mode 100644 index 00000000000..86dd8e03c8a --- /dev/null +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -0,0 +1,204 @@ +--- +pcx_content_type: how-to +title: Expose your dev server +description: Share your local Workers dev server with others using Cloudflare Tunnel. +sidebar: + order: 5 +head: [] +--- + +import { Tabs, TabItem } from "~/components"; + +When you run `wrangler dev` or `vite dev` (with the [Cloudflare Vite plugin](/workers/vite-plugin/)), your Worker runs on a local HTTP server bound to `localhost:8787`. This means only your machine can reach it. + +To share your dev server with teammates, test from a mobile device, or receive webhooks from external services, you can use [Cloudflare Tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/) to create a public URL that routes traffic to your local server. + +## How it works + +[`cloudflared`](/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/) runs alongside your dev server and creates an outbound-only connection to the Cloudflare network. Cloudflare assigns a public URL that proxies requests through this connection to `localhost:8787` on your machine. + +Your dev server stays on `localhost`. `cloudflared` handles TLS termination at the Cloudflare edge and encrypts the tunnel connection automatically. Hot reload continues to work because `wrangler dev` uses a stable proxy on port `8787` that persists across code changes. + +## Prerequisites + +- [Install `cloudflared`](/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/) on your machine. +- A working Workers project with `wrangler dev` or `vite dev` running. + +## Quick tunnel (no account required) + +A [quick tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/) generates a temporary public URL on `trycloudflare.com`. No Cloudflare account is needed. This is useful for quick testing or sharing a preview link. + +### Start your dev server + + + + + ```sh + npx wrangler dev + ``` + + + + + ```sh + yarn wrangler dev + ``` + + + + + ```sh + pnpm wrangler dev + ``` + + + + + ```sh + npx vite dev + ``` + + + + +By default, this starts a server on `http://localhost:8787`. + +### Start a quick tunnel + +In a separate terminal: + +```sh +cloudflared tunnel --url http://localhost:8787 +``` + +`cloudflared` prints a URL like `https://random-words.trycloudflare.com`. Anyone with this URL can reach your dev server. + +### Send requests to the public URL + +```sh +curl https://random-words.trycloudflare.com +``` + +The request travels through the Cloudflare network, through the tunnel, and reaches your local Worker. + +:::note +Quick tunnels have a limit of 200 concurrent in-flight requests and do not support Server-Sent Events (SSE). For higher limits or persistent hostnames, use a [named tunnel](#named-tunnel-persistent-hostname). +::: + +## Named tunnel (persistent hostname) + +A [named tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/) gives you a stable hostname on your own domain. This requires a Cloudflare account with a domain. + +### Authenticate and create the tunnel + +```sh +cloudflared tunnel login +cloudflared tunnel create my-worker-dev +``` + +### Route DNS to the tunnel + +```sh +cloudflared tunnel route dns my-worker-dev dev-worker.example.com +``` + +This creates a CNAME record pointing `dev-worker.example.com` to your tunnel. + +### Configure the tunnel + +Create `~/.cloudflared/config.yml`: + +```yaml +tunnel: my-worker-dev +credentials-file: ~/.cloudflared/.json + +ingress: + - hostname: dev-worker.example.com + service: http://localhost:8787 + - service: http_status:404 +``` + +Replace `` with the UUID printed when you created the tunnel. + +### Start your dev server and tunnel + +In one terminal, start your dev server: + +```sh +npx wrangler dev +``` + +In a second terminal, start the tunnel: + +```sh +cloudflared tunnel run my-worker-dev +``` + +Your Worker is now reachable at `https://dev-worker.example.com`. + +### Restrict access + +Anyone who knows the hostname can reach your dev server. To restrict access, [create a Cloudflare Access application](/cloudflare-one/applications/configure-apps/self-hosted-public-app/) for the hostname and configure a policy that limits access to your team. + +## Configuration + +### Port matching + +The port in the `cloudflared` command or configuration file must match the port your dev server listens on. If you change the dev server port, update the tunnel to match: + +```sh +npx wrangler dev --port 3000 +``` + +```sh +cloudflared tunnel --url http://localhost:3000 +``` + +### Interface binding + +By default, `wrangler dev` binds to `localhost`. Because `cloudflared` runs on the same machine and connects to `localhost`, this works without changes. You do not need `--ip 0.0.0.0`. + +Only use `--ip 0.0.0.0` if `cloudflared` runs on a different machine on your network: + +```sh +npx wrangler dev --ip 0.0.0.0 --port 8787 +``` + +### Local mode vs remote mode + +Use the default mode or `--local` — both run your Worker code locally, which is what you want when tunneling back to your machine. Do not use `--remote`, which uploads your code to the Cloudflare network and defeats the purpose of a tunnel to your local server. + +### Custom port with Vite + +When using the Cloudflare Vite plugin, configure the port in `vite.config.js`: + +```js +import { defineConfig } from "vite"; +import { cloudflare } from "@cloudflare/vite-plugin"; + +export default defineConfig({ + plugins: [cloudflare()], + server: { + port: 8787, + }, +}); +``` + +Then point `cloudflared` at the same port. + +## Common use cases + +| Use case | Approach | +| --- | --- | +| Share a preview link with a teammate | Quick tunnel — send them the `trycloudflare.com` URL | +| Test from a mobile device on the same network | Quick tunnel or named tunnel — open the URL on your phone | +| Receive webhooks from an external service (for example, Stripe or GitHub) | Quick tunnel or named tunnel — set the webhook URL to the tunnel hostname | +| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/applications/configure-apps/self-hosted-public-app/) | + +## Limitations + +- Quick tunnels generate a new URL each time you restart `cloudflared`. For stable URLs, use a named tunnel. +- Quick tunnels are capped at 200 concurrent in-flight requests. +- Quick tunnels do not support Server-Sent Events (SSE). +- If you have an existing `~/.cloudflared/config.yaml`, quick tunnels may not work. Rename the file temporarily or use a named tunnel instead. +- Tunnel latency adds round-trip time to every request. This is acceptable for development but is not representative of production performance. diff --git a/src/content/docs/workers/development-testing/index.mdx b/src/content/docs/workers/development-testing/index.mdx index 759f0bd243a..e16858766be 100644 --- a/src/content/docs/workers/development-testing/index.mdx +++ b/src/content/docs/workers/development-testing/index.mdx @@ -51,6 +51,8 @@ Both Wrangler and the Cloudflare Vite plugin use [Miniflare](/workers/testing/mi - [Get started with Wrangler](/workers/wrangler/install-and-update/) - [Get started with the Cloudflare Vite plugin](/workers/vite-plugin/get-started/) +To share your dev server with others or receive external webhooks, refer to [Expose your dev server](/workers/development-testing/expose-dev-server/). + ### Defaults By default, running `wrangler dev` / `vite dev` (when using the [Vite plugin](/workers/vite-plugin/get-started/)) means that: diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index 6d86f4e196d..a3a9298acdc 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -196,7 +196,7 @@ None of the options for this command are required. Many of these options can be - `--ip` - IP address to listen on, defaults to `localhost`. - `--port` - - Port to listen on. + - Port to listen on. If you change the port, make sure any [Cloudflare Tunnel pointing to your dev server](/workers/development-testing/expose-dev-server/) uses the same port. - `--inspector-port` - Port for devtools to connect to. - `--routes`, `--route` From a5639ef84b30ab16df65c58f6fb32fdd1e477d54 Mon Sep 17 00:00:00 2001 From: Brendan Irvine-Broque Date: Mon, 9 Feb 2026 16:22:24 -0800 Subject: [PATCH 2/7] Apply suggestion from @irvinebroque --- src/content/docs/workers/wrangler/commands.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/workers/wrangler/commands.mdx b/src/content/docs/workers/wrangler/commands.mdx index a3a9298acdc..6d86f4e196d 100644 --- a/src/content/docs/workers/wrangler/commands.mdx +++ b/src/content/docs/workers/wrangler/commands.mdx @@ -196,7 +196,7 @@ None of the options for this command are required. Many of these options can be - `--ip` - IP address to listen on, defaults to `localhost`. - `--port` - - Port to listen on. If you change the port, make sure any [Cloudflare Tunnel pointing to your dev server](/workers/development-testing/expose-dev-server/) uses the same port. + - Port to listen on. - `--inspector-port` - Port for devtools to connect to. - `--routes`, `--route` From 46a2105c8cf2c48c6440031b1be29b1ef171ac9b Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 10 Feb 2026 00:24:32 +0000 Subject: [PATCH 3/7] Fix invalid self-hosted-app links Co-authored-by: irvinebroque --- .../docs/workers/development-testing/expose-dev-server.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx index 86dd8e03c8a..3e2a2f98e12 100644 --- a/src/content/docs/workers/development-testing/expose-dev-server.mdx +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -138,7 +138,7 @@ Your Worker is now reachable at `https://dev-worker.example.com`. ### Restrict access -Anyone who knows the hostname can reach your dev server. To restrict access, [create a Cloudflare Access application](/cloudflare-one/applications/configure-apps/self-hosted-public-app/) for the hostname and configure a policy that limits access to your team. +Anyone who knows the hostname can reach your dev server. To restrict access, [create a Cloudflare Access application](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) for the hostname and configure a policy that limits access to your team. ## Configuration @@ -193,7 +193,7 @@ Then point `cloudflared` at the same port. | Share a preview link with a teammate | Quick tunnel — send them the `trycloudflare.com` URL | | Test from a mobile device on the same network | Quick tunnel or named tunnel — open the URL on your phone | | Receive webhooks from an external service (for example, Stripe or GitHub) | Quick tunnel or named tunnel — set the webhook URL to the tunnel hostname | -| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/applications/configure-apps/self-hosted-public-app/) | +| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) | ## Limitations From b826fc53a93615c1fce3029beea4f3282ade6485 Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 10 Feb 2026 19:16:06 +0000 Subject: [PATCH 4/7] Use PackageManagers component and address review feedback --- .../development-testing/expose-dev-server.mdx | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx index 3e2a2f98e12..3941dca303d 100644 --- a/src/content/docs/workers/development-testing/expose-dev-server.mdx +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -7,7 +7,7 @@ sidebar: head: [] --- -import { Tabs, TabItem } from "~/components"; +import { PackageManagers } from "~/components"; When you run `wrangler dev` or `vite dev` (with the [Cloudflare Vite plugin](/workers/vite-plugin/)), your Worker runs on a local HTTP server bound to `localhost:8787`. This means only your machine can reach it. @@ -17,7 +17,7 @@ To share your dev server with teammates, test from a mobile device, or receive w [`cloudflared`](/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/) runs alongside your dev server and creates an outbound-only connection to the Cloudflare network. Cloudflare assigns a public URL that proxies requests through this connection to `localhost:8787` on your machine. -Your dev server stays on `localhost`. `cloudflared` handles TLS termination at the Cloudflare edge and encrypts the tunnel connection automatically. Hot reload continues to work because `wrangler dev` uses a stable proxy on port `8787` that persists across code changes. +Your dev server stays on `localhost`. `cloudflared` handles TLS termination and encrypts the tunnel connection automatically. Hot reload continues to work because `wrangler dev` uses a stable proxy on port `8787` that persists across code changes. ## Prerequisites @@ -30,36 +30,11 @@ A [quick tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-w ### Start your dev server - - + - ```sh - npx wrangler dev - ``` +Or, if you are using the [Cloudflare Vite plugin](/workers/vite-plugin/): - - - - ```sh - yarn wrangler dev - ``` - - - - - ```sh - pnpm wrangler dev - ``` - - - - - ```sh - npx vite dev - ``` - - - + By default, this starts a server on `http://localhost:8787`. @@ -164,10 +139,6 @@ Only use `--ip 0.0.0.0` if `cloudflared` runs on a different machine on your net npx wrangler dev --ip 0.0.0.0 --port 8787 ``` -### Local mode vs remote mode - -Use the default mode or `--local` — both run your Worker code locally, which is what you want when tunneling back to your machine. Do not use `--remote`, which uploads your code to the Cloudflare network and defeats the purpose of a tunnel to your local server. - ### Custom port with Vite When using the Cloudflare Vite plugin, configure the port in `vite.config.js`: @@ -201,4 +172,3 @@ Then point `cloudflared` at the same port. - Quick tunnels are capped at 200 concurrent in-flight requests. - Quick tunnels do not support Server-Sent Events (SSE). - If you have an existing `~/.cloudflared/config.yaml`, quick tunnels may not work. Rename the file temporarily or use a named tunnel instead. -- Tunnel latency adds round-trip time to every request. This is acceptable for development but is not representative of production performance. From 417b7fb51975f117be2082a56188ac79918b016e Mon Sep 17 00:00:00 2001 From: "opencode-agent[bot]" Date: Tue, 10 Feb 2026 23:38:50 +0000 Subject: [PATCH 5/7] Show both managed (recommended) and local tunnel setup Address reviewer feedback to show dashboard-managed tunnels as the recommended approach alongside the CLI-based local configuration, using tabs to present both options concisely. --- .../development-testing/expose-dev-server.mdx | 82 +++++++++++-------- 1 file changed, 49 insertions(+), 33 deletions(-) diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx index 3941dca303d..8df8dd1febf 100644 --- a/src/content/docs/workers/development-testing/expose-dev-server.mdx +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -7,7 +7,7 @@ sidebar: head: [] --- -import { PackageManagers } from "~/components"; +import { PackageManagers, Tabs, TabItem } from "~/components"; When you run `wrangler dev` or `vite dev` (with the [Cloudflare Vite plugin](/workers/vite-plugin/)), your Worker runs on a local HTTP server bound to `localhost:8787`. This means only your machine can reach it. @@ -62,54 +62,70 @@ Quick tunnels have a limit of 200 concurrent in-flight requests and do not suppo ## Named tunnel (persistent hostname) -A [named tunnel](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/) gives you a stable hostname on your own domain. This requires a Cloudflare account with a domain. +A named tunnel gives you a stable hostname on your own domain. This requires a Cloudflare account with a domain. You can create a named tunnel using the Cloudflare dashboard (recommended) or the `cloudflared` CLI. -### Authenticate and create the tunnel + + -```sh -cloudflared tunnel login -cloudflared tunnel create my-worker-dev -``` + Create and manage the tunnel from the Cloudflare One dashboard: -### Route DNS to the tunnel + 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com) and go to **Networks** > **Connectors** > **Cloudflare Tunnels**. + 2. Select **Create a tunnel**, choose **Cloudflared**, and give it a name (for example, `my-worker-dev`). + 3. Install and run `cloudflared` using the command shown in the dashboard. + 4. On the **Published applications** tab, add a public hostname (for example, `dev-worker.example.com`) and set the service to `HTTP` / `localhost:8787`. + 5. Select **Save**. -```sh -cloudflared tunnel route dns my-worker-dev dev-worker.example.com -``` + For full details, refer to [Create a tunnel (dashboard)](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/). -This creates a CNAME record pointing `dev-worker.example.com` to your tunnel. + Start your dev server in a separate terminal: -### Configure the tunnel + ```sh + npx wrangler dev + ``` -Create `~/.cloudflared/config.yml`: + Your Worker is now reachable at `https://dev-worker.example.com`. -```yaml -tunnel: my-worker-dev -credentials-file: ~/.cloudflared/.json + + -ingress: - - hostname: dev-worker.example.com - service: http://localhost:8787 - - service: http_status:404 -``` + Create and configure the tunnel locally with `cloudflared`: -Replace `` with the UUID printed when you created the tunnel. + ```sh + cloudflared tunnel login + cloudflared tunnel create my-worker-dev + cloudflared tunnel route dns my-worker-dev dev-worker.example.com + ``` -### Start your dev server and tunnel + Create `~/.cloudflared/config.yml`: -In one terminal, start your dev server: + ```yaml + tunnel: my-worker-dev + credentials-file: ~/.cloudflared/.json -```sh -npx wrangler dev -``` + ingress: + - hostname: dev-worker.example.com + service: http://localhost:8787 + - service: http_status:404 + ``` -In a second terminal, start the tunnel: + Replace `` with the UUID printed when you created the tunnel. -```sh -cloudflared tunnel run my-worker-dev -``` + Start your dev server in one terminal: + + ```sh + npx wrangler dev + ``` + + In a second terminal, start the tunnel: + + ```sh + cloudflared tunnel run my-worker-dev + ``` + + Your Worker is now reachable at `https://dev-worker.example.com`. -Your Worker is now reachable at `https://dev-worker.example.com`. + + ### Restrict access From b6ca840a359699ac218936669a4c109abcc44f55 Mon Sep 17 00:00:00 2001 From: "ask-bonk[bot]" Date: Fri, 20 Feb 2026 15:13:27 +0000 Subject: [PATCH 6/7] [Workers] Point tunnel dashboard instructions to Core Dashboard (Networking > Tunnels) Per the 2026-02-20 changelog, Tunnel management for public applications is now available in the main Cloudflare Dashboard. Update the recommended dashboard flow to use Networking > Tunnels instead of the Cloudflare One dashboard. --- .../development-testing/expose-dev-server.mdx | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx index 8df8dd1febf..a9dcb8834f9 100644 --- a/src/content/docs/workers/development-testing/expose-dev-server.mdx +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -67,62 +67,62 @@ A named tunnel gives you a stable hostname on your own domain. This requires a C - Create and manage the tunnel from the Cloudflare One dashboard: +Create and manage the tunnel from the Cloudflare dashboard: - 1. Log in to [Cloudflare One](https://one.dash.cloudflare.com) and go to **Networks** > **Connectors** > **Cloudflare Tunnels**. - 2. Select **Create a tunnel**, choose **Cloudflared**, and give it a name (for example, `my-worker-dev`). - 3. Install and run `cloudflared` using the command shown in the dashboard. - 4. On the **Published applications** tab, add a public hostname (for example, `dev-worker.example.com`) and set the service to `HTTP` / `localhost:8787`. - 5. Select **Save**. +1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/tunnels) and go to **Networking** > **Tunnels**. +2. Select **Create a tunnel**, choose **Cloudflared**, and give it a name (for example, `my-worker-dev`). +3. Install and run `cloudflared` using the command shown in the dashboard. +4. On the **Published applications** tab, add a public hostname (for example, `dev-worker.example.com`) and set the service to `HTTP` / `localhost:8787`. +5. Select **Save**. - For full details, refer to [Create a tunnel (dashboard)](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/). +For full details, refer to [Create a tunnel (dashboard)](/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/). - Start your dev server in a separate terminal: +Start your dev server in a separate terminal: - ```sh - npx wrangler dev - ``` +```sh +npx wrangler dev +``` - Your Worker is now reachable at `https://dev-worker.example.com`. +Your Worker is now reachable at `https://dev-worker.example.com`. - Create and configure the tunnel locally with `cloudflared`: +Create and configure the tunnel locally with `cloudflared`: - ```sh - cloudflared tunnel login - cloudflared tunnel create my-worker-dev - cloudflared tunnel route dns my-worker-dev dev-worker.example.com - ``` +```sh +cloudflared tunnel login +cloudflared tunnel create my-worker-dev +cloudflared tunnel route dns my-worker-dev dev-worker.example.com +``` - Create `~/.cloudflared/config.yml`: +Create `~/.cloudflared/config.yml`: - ```yaml - tunnel: my-worker-dev - credentials-file: ~/.cloudflared/.json +```yaml +tunnel: my-worker-dev +credentials-file: ~/.cloudflared/.json - ingress: - - hostname: dev-worker.example.com - service: http://localhost:8787 - - service: http_status:404 - ``` +ingress: + - hostname: dev-worker.example.com + service: http://localhost:8787 + - service: http_status:404 +``` - Replace `` with the UUID printed when you created the tunnel. +Replace `` with the UUID printed when you created the tunnel. - Start your dev server in one terminal: +Start your dev server in one terminal: - ```sh - npx wrangler dev - ``` +```sh +npx wrangler dev +``` - In a second terminal, start the tunnel: +In a second terminal, start the tunnel: - ```sh - cloudflared tunnel run my-worker-dev - ``` +```sh +cloudflared tunnel run my-worker-dev +``` - Your Worker is now reachable at `https://dev-worker.example.com`. +Your Worker is now reachable at `https://dev-worker.example.com`. @@ -164,10 +164,10 @@ import { defineConfig } from "vite"; import { cloudflare } from "@cloudflare/vite-plugin"; export default defineConfig({ - plugins: [cloudflare()], - server: { - port: 8787, - }, + plugins: [cloudflare()], + server: { + port: 8787, + }, }); ``` @@ -175,12 +175,12 @@ Then point `cloudflared` at the same port. ## Common use cases -| Use case | Approach | -| --- | --- | -| Share a preview link with a teammate | Quick tunnel — send them the `trycloudflare.com` URL | -| Test from a mobile device on the same network | Quick tunnel or named tunnel — open the URL on your phone | -| Receive webhooks from an external service (for example, Stripe or GitHub) | Quick tunnel or named tunnel — set the webhook URL to the tunnel hostname | -| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) | +| Use case | Approach | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +| Share a preview link with a teammate | Quick tunnel — send them the `trycloudflare.com` URL | +| Test from a mobile device on the same network | Quick tunnel or named tunnel — open the URL on your phone | +| Receive webhooks from an external service (for example, Stripe or GitHub) | Quick tunnel or named tunnel — set the webhook URL to the tunnel hostname | +| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) | ## Limitations From 6f4b521e85ea429432178a9895d66546daf131a4 Mon Sep 17 00:00:00 2001 From: "ask-bonk[bot]" Date: Fri, 20 Feb 2026 15:30:15 +0000 Subject: [PATCH 7/7] [Workers] Add missing links for quick tunnel, named tunnel, and related concepts --- .../development-testing/expose-dev-server.mdx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content/docs/workers/development-testing/expose-dev-server.mdx b/src/content/docs/workers/development-testing/expose-dev-server.mdx index a9dcb8834f9..4e144525c02 100644 --- a/src/content/docs/workers/development-testing/expose-dev-server.mdx +++ b/src/content/docs/workers/development-testing/expose-dev-server.mdx @@ -62,7 +62,7 @@ Quick tunnels have a limit of 200 concurrent in-flight requests and do not suppo ## Named tunnel (persistent hostname) -A named tunnel gives you a stable hostname on your own domain. This requires a Cloudflare account with a domain. You can create a named tunnel using the Cloudflare dashboard (recommended) or the `cloudflared` CLI. +A named tunnel gives you a stable hostname on your own domain. This requires a Cloudflare account with a domain. You can create a named tunnel using the Cloudflare dashboard (recommended) or the [`cloudflared` CLI](/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/). @@ -157,7 +157,7 @@ npx wrangler dev --ip 0.0.0.0 --port 8787 ### Custom port with Vite -When using the Cloudflare Vite plugin, configure the port in `vite.config.js`: +When using the [Cloudflare Vite plugin](/workers/vite-plugin/), configure the port in `vite.config.js`: ```js import { defineConfig } from "vite"; @@ -175,16 +175,16 @@ Then point `cloudflared` at the same port. ## Common use cases -| Use case | Approach | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| Share a preview link with a teammate | Quick tunnel — send them the `trycloudflare.com` URL | -| Test from a mobile device on the same network | Quick tunnel or named tunnel — open the URL on your phone | -| Receive webhooks from an external service (for example, Stripe or GitHub) | Quick tunnel or named tunnel — set the webhook URL to the tunnel hostname | -| Persistent dev environment for a team | Named tunnel with a stable hostname and an [Access policy](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) | +| Use case | Approach | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Share a preview link with a teammate | [Quick tunnel](#quick-tunnel-no-account-required) — send them the `trycloudflare.com` URL | +| Test from a mobile device on the same network | [Quick tunnel](#quick-tunnel-no-account-required) or [named tunnel](#named-tunnel-persistent-hostname) — open the URL on your phone | +| Receive webhooks from an external service (for example, Stripe or GitHub) | [Quick tunnel](#quick-tunnel-no-account-required) or [named tunnel](#named-tunnel-persistent-hostname) — set the webhook URL to the tunnel hostname | +| Persistent dev environment for a team | [Named tunnel](#named-tunnel-persistent-hostname) with a stable hostname and an [Access policy](/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/) | ## Limitations -- Quick tunnels generate a new URL each time you restart `cloudflared`. For stable URLs, use a named tunnel. +- [Quick tunnels](/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/) generate a new URL each time you restart `cloudflared`. For stable URLs, use a [named tunnel](#named-tunnel-persistent-hostname). - Quick tunnels are capped at 200 concurrent in-flight requests. - Quick tunnels do not support Server-Sent Events (SSE). -- If you have an existing `~/.cloudflared/config.yaml`, quick tunnels may not work. Rename the file temporarily or use a named tunnel instead. +- If you have an existing `~/.cloudflared/config.yaml`, quick tunnels may not work. Rename the file temporarily or use a [named tunnel](#named-tunnel-persistent-hostname) instead.