Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers https

How to enable and implement the Node.js https module in Cloudflare Workers using specific compatibility flags for both client-side requests and server-side creation.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers https

How to enable and implement the Node.js https module in Cloudflare Workers using specific compatibility flags for both client-side requests and server-side creation.

When To Use

Use when you need to migrate Node.js https code to Cloudflare Workers or implement TLS-encrypted HTTP client and server functionality using Node.js compatibility APIs.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-nodejs-https-workflow-guide.mdDocumentation detailing the client-side and server-side methods available for the Node.js https module within Cloudflare Workers.Questions about documentation detailing the client-side and server-side methods available for the Node.js https module within Cloudfl...
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-compat.textA configuration snippet showing the required compatibility flags to enable Node.js HTTP modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A configuration snippet showing the required compatibility flags to enable Node.js HTTP modules in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-compat-2.textA text snippet showing the required compatibility flags to enable Node.js HTTP server modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text snippet showing the required compatibility flags to enable Node.js HTTP server modules in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-compat-3.textA text snippet showing the required compatibility flags for using Node.js HTTPS modules in Cloudflare Workers.Exact payloads, commands, or snippets shown in A text snippet showing the required compatibility flags for using Node.js HTTPS modules in Cloudflare Workers.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-get.textA JavaScript example demonstrating how to use the node:https module to perform a GET request within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:https module to perform a GET request within a Cloudflare Worker.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-reques.textA JavaScript example demonstrating how to use the node:https module within a Cloudflare Worker to perform a GET request.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the node:https module within a Cloudflare Worker to perform a GET request.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-server.textA Node.js HTTPS server implementation using the createServer method within a Cloudflare Workers environment.Exact payloads, commands, or snippets shown in A Node.js HTTPS server implementation using the createServer method within a Cloudflare Workers environment.
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-create.textA Node.js compatible example demonstrating how to use the createServer function from the node:https module within a Cloudflare Worker.Exact payloads, commands, or snippets shown in A Node.js compatible example demonstrating how to use the createServer function from the node:https module within a C...
examples/workers-runtime-apis-nodejs-https-cloudflare-workers-nodejs-https-server-2.textA Node.js HTTPS server implementation using the Workers runtime API to handle incoming requests.Exact payloads, commands, or snippets shown in A Node.js HTTPS server implementation using the Workers runtime API to handle incoming requests.

What This Skill Covers

  • To enable built-in Node.js APIs and polyfills, add the nodejs\compat compatibility flag to your Wrangler configuration file. This also enables nodejs\compat...
  • Main sections: Compatibility flags, Client-side methods, Server-side methods, get, request.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/runtime-apis/nodejs/https