Skip to content

[wrangler] add connect wrangler config section - #14995

Open
ThomasRubini wants to merge 10 commits into
cloudflare:mainfrom
ThomasRubini:feature/tcp-handlers
Open

[wrangler] add connect wrangler config section#14995
ThomasRubini wants to merge 10 commits into
cloudflare:mainfrom
ThomasRubini:feature/tcp-handlers

Conversation

@ThomasRubini

@ThomasRubini ThomasRubini commented Aug 3, 2026

Copy link
Copy Markdown

This PR adds a tcp_handlers config section, for the upcoming inbound TCP feature on Workers. It will configure workerd TCP listeners as implemented in cloudflare/workerd#6059

It would have to be set in the wrangler config like this:

{
	"connect": [{
		"protocol": "tcp",
		"port": 5432,
		"address": "127.0.0.1", // default
	}],
}

or in the new config format like this:

import { defineWorker, triggers } from "@cloudflare/config";

export default defineWorker({
  triggers: [triggers.connect({ protocol: "tcp", port: 5432, address: "127.0.0.1" })],
});

I'd love feedback on the tcp_handlers name. Please also note that UDP handlers are planned, so if this name is merged, it would probably also mean adding a udp_handlers section in the future.

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2ba31c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
wrangler Minor
miniflare Minor
@cloudflare/workers-utils Minor
@cloudflare/config Minor
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch
@cloudflare/remote-bindings Patch
@cloudflare/runtime-types Patch
@cloudflare/autoconfig Patch
@cloudflare/build-output-utils Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/workers-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
workers-devprod requested review from a team and petebacondarwin and removed request for a team August 3, 2026 15:14
@workers-devprod

workers-devprod commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14995

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@14995

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14995

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14995

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14995

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14995

miniflare

npm i https://pkg.pr.new/miniflare@14995

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@14995

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14995

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14995

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14995

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14995

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14995

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14995

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14995

wrangler

npm i https://pkg.pr.new/wrangler@14995

commit: 2ba31c3

devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz
dario-piotrowicz requested review from dario-piotrowicz and removed request for petebacondarwin August 4, 2026 15:07

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, although an option for this should also be added to the programmatic wrangler config

devin-ai-integration[bot]

This comment was marked as resolved.

@ThomasRubini ThomasRubini changed the title [wrangler] add tcp_handlers wrangler config section [wrangler] add connect wrangler config section Aug 4, 2026
@ThomasRubini
ThomasRubini force-pushed the feature/tcp-handlers branch from d65961f to fdfb8df Compare August 5, 2026 13:59
@ThomasRubini

Copy link
Copy Markdown
Author

I think the test failures are unrelated to my changes. Could someone from the team confirm ?

@dario-piotrowicz

Copy link
Copy Markdown
Member

I think the test failures are unrelated to my changes. Could someone from the team confirm ?

yes, they are not, CI's been quite flaky lately 😓

Feels free to ignore them 👍

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned in my comment I really don't like the inclusion of "udp" here, besides that everything else looks good to me

Comment thread .changeset/connect-handlers.md Outdated
@ThomasRubini
ThomasRubini force-pushed the feature/tcp-handlers branch from c689ffc to 2ba31c3 Compare August 6, 2026 12:28

@dario-piotrowicz dario-piotrowicz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the udp removal @ThomasRubini 🙏

Looks good to me 😄

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

3 participants