Edge Computing with Cloudflare Workers
Making connections with TCP and Sockets for Workers

Making connections with TCP and Sockets for Workers

11/15/2021 · James M Snell

What this post added

This post introduces the development of new APIs and infrastructure for Cloudflare Workers to support non-HTTP socket connections (TCP, UDP, QUIC). It details an initial approach using WebSockets tunneled over Cloudflare Tunnels to connect to a PostgreSQL database, highlighting its limitations. The post proposes a new, standardized JavaScript API for socket connections, designed to be cross-runtime compatible and built on existing Web Platform standards. It also announces 'Socket Workers,' which will allow Workers to be connected to directly using raw TCP, UDP, or QUIC protocols, enabling the implementation of various server-side protocols like SMTP, MQTT, and VoIP at the edge.

Read the original post ↗