Announcing connect() — a new API for creating TCP sockets from Cloudflare Workers
May 16, 2023Brendan Irvine-Broque, Matt Silverlock

Summary
This post introduces the new `connect()` API for Cloudflare Workers, enabling outbound TCP socket connections. This significantly expands Workers' capabilities by allowing direct connections to any TCP-based service, including databases, which was previously a major limitation. The API is designed to be interoperable and simplifies TLS handling. The post highlights its immediate impact with the integration of the popular `pg` PostgreSQL driver, paving the way for broader database connectivity and full-stack application development on Workers.