cloudflare · Cloudflare Workers Docs
Workers TCP sockets
Teaches how to use the connect() API to establish outbound TCP connections from Cloudflare Workers to support application-layer protocols like SSH, MQTT, or database wire protocols.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers TCP sockets
Teaches how to use the connect() API to establish outbound TCP connections from Cloudflare Workers to support application-layer protocols like SSH, MQTT, or database wire protocols.
When To Use
Use when you need to implement outbound TCP connections for protocols such as SSH, SMTP, or direct database communication from a Worker environment.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-runtime-apis-tcp-sockets-workflow-guide.md | Documentation detailing the connect API, SocketAddress, SocketOptions, and SocketInfo for establishing outbound TCP connections in Cloudflare Workers. | Questions about documentation detailing the connect API, SocketAddress, SocketOptions, and SocketInfo for establishing outbound TCP c... |
examples/workers-runtime-apis-tcp-sockets-cloudflare-workers-tcp-sockets-gopher-c.text | A JavaScript code example demonstrating how to use the cloudflare:sockets API to establish a TCP connection to a gopher server. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the cloudflare:sockets API to establish a TCP connection to a goph... |
examples/workers-runtime-apis-tcp-sockets-cloudflare-workers-tcp-sockets-connect-.text | A JavaScript code example demonstrating how to establish a TCP connection and initiate a STARTTLS handshake using the cloudflare:sockets API. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to establish a TCP connection and initiate a STARTTLS handshake using the... |
examples/workers-runtime-apis-tcp-sockets-cloudflare-workers-tcp-sockets-connect.text | A JavaScript code example demonstrating how to use the connect function from cloudflare:sockets to establish a TCP connection to a remote host. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the connect function from cloudflare:sockets to establish a TCP co... |
examples/workers-runtime-apis-tcp-sockets-cloudflare-workers-tcp-sockets-connect-2.text | A JavaScript code example demonstrating how to use the connect function from the cloudflare:sockets module to establish a TCP connection. | Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the connect function from the cloudflare:sockets module to establi... |
What This Skill Covers
- The Workers runtime provides the connect() API for creating outbound TCP connections ↗ from Workers.
- Main sections:
connect(),SocketAddress,SocketOptions,SocketInfo,Socket.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets
