Cloudflare

Making connections with TCP and Sockets for Workers

Nov 15, 2021James M Snell
Making connections with TCP and Sockets for Workers
SummaryAI, from the source post

Introduces the development of APIs and infrastructure to support TCP, UDP, and QUIC-based protocols in Cloudflare Workers, enabling non-HTTP socket connections. Demonstrates an example of connecting to a remote Postgres server via WebSocket over a Cloudflare Tunnel using a Deno-based Postgres client driver adapted for standard fetch and WebSockets APIs. Proposes a new, standardized JavaScript API for socket connections (client-side) and introduces the concept of 'Socket Workers' that can be connected to directly using raw TCP, UDP, or QUIC protocols.

More from the Edge Computing with Cloudflare Workers trail