{
  "slug": "wrangler-dev-supports-raw-socket-connect-triggers-def490770749",
  "title": "wrangler dev supports raw socket connect triggers",
  "tools": [
    "wrangler"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-08-20T17:42:57.000Z",
  "announced_at": "2026-08-20T17:42:57.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When configuring raw TCP connections for local development, enable the `experimental` compatibility flag and add a `connect` trigger; `wrangler dev` forwards connections to the Worker’s `connect(socket, env, ctx)` handler. [Release note](https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.125.0)",
    "examples": [
      "{\n  \"compatibility_flags\": [\"experimental\"],\n  \"connect\": [{ \"protocol\": \"tcp\", \"port\": 5432 }]\n}",
      "import { defineWorker, triggers } from \"@cloudflare/config\";\n\nexport default defineWorker({\n  triggers: [\n    triggers.connect({ protocol: \"tcp\", port: 5432, address: \"127.0.0.1\" }),\n  ],\n});",
      "npx wrangler dev"
    ],
    "gotchas": [
      "Version: 4.125.0",
      "compatibility_flags: \"experimental\" (required): Required compatibility flag for the connect trigger.",
      "connect[].protocol (required): Protocol to listen for; only `\"tcp\"` is supported.",
      "connect[].port (required): Port for the listening socket. The example uses `5432`.",
      "connect[].address: Listening address; defaults to `127.0.0.1`.",
      "triggers.connect(...): `@cloudflare/config` declaration that lowers to the `connect` field.",
      "Requires the `experimental` compatibility flag.",
      "Only `\"tcp\"` is supported at the moment.",
      "Each entry listens on `127.0.0.1` unless an `address` is given.",
      "Connections bypass the local dev HTTP entry point."
    ]
  },
  "why_it_matters": "Configure a Worker to handle raw TCP connections during local development.",
  "sources": [
    "https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%404.125.0",
    "https://developers.cloudflare.com/workers/wrangler/commands/workers/"
  ],
  "rank": 0.98025,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-eaa6e43c788a099f-0:gate",
    "evidence_hash": "6bd888ac08b040d86374f347bbc03f7831e8277618b7511c3f6d7421f7b32c36"
  },
  "review": {
    "draft_hash": "fec9a86577e2b26a5f07a2801e8c69b519dd7b0ff282176f42334d6512d07f19",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.70 (>= 0.6 needed)."
  }
}
