Cloudflare Workers Introduces Connect() API to Create TCP Sockets

Cloudflare has launched a socket API that allows developers to create outbound TCP sockets to connect back to TCP-based infrastructures directly from a Worker. The API is available as a Runtime API, and the connect() function returns a TCP socket that allows developers to read and write data. Workers already interacted with HTTP endpoints and other Cloudflare services, but most databases required clients to connect by opening a direct TCP socket. The new development aims to support standard APIs that are supported across browsers and non-browser environments wherever possible, and the connectivity to databases is viewed as one of the biggest current challenges of connecting to databases from serverless functions.

https://www.infoq.com/news/2023/05/cloudflare-workers-connect-api/

To top