Index of every page on this site: llms.txt
All skills
jasnell avatar

/node-networking

@5f83e6c
Run it yourself

Networking APIs and behavior changes since Node.js 24 in net, dgram, tls, http and http2. Use to reserve a port before listening, block private IPs (SSRF), cancel work when a client disconnects, send 103 Early Hints, honor HTTP_PROXY/HTTPS_PROXY, validate header values, use promise-based net, or debug keepAliveTimeout (now 65s), upgrade-request bodies or dns.reverse. Covers node:net/promises, net.BoundSocket, BlockList PRIVATE_RANGES, setKeepAlive({ interval, count }), dgram bindSync, TLS certificateCompression, http.isValidHeaderValue, websocketMask, req.signal, NODE_USE_ENV_PROXY and HTTP/2 http1Options. Node.js 24+, some 26/27+.

Use this Skill: https://skilld.dev/gh/jasnell/node-skills/node-networking

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

ruleshttp2.md

≈677 tokens on demand. Your agent reads this file only when SKILL.md points to it.

HTTP/2 additions

Source: doc/api/http2.md at nodejs/node ab476eccd03. Examples: http2-options.mjs, http2-window.mjs, write-information.mjs.

http1Options (v25.7.0, v24.15.0)

These options are passed to the HTTP/1 server used when allowHTTP1: true. Any http.createServer() option is accepted, including IncomingMessage, ServerResponse, and keepAliveTimeout. They replace the deprecated top-level Http1IncomingMessage / Http1ServerResponse (DEP0202). They do not affect HTTP/2 requests. keepAliveTimeout: 3000 produced Keep-Alive: timeout=3.

The docs list http1Options.keepAliveTimeout Default: 5000. On main the observed default is 65 s, matching http.Server. On v24.19 it is 5 s.

strictSingleValueFields (v25.7.0, v24.15.0; default true)

This option is accepted by createServer/createSecureServer (documented) and by http2.connect (observed working, undocumented). When true, sending several values for a single-value field such as content-type throws ERR_HTTP2_HEADER_SINGLE_VALUE from stream.respond() / client.request(). With false, the duplicates are sent and the receiving side keeps the first value. With the compat API, res.setHeader(name, [a, b]) succeeds and the throw happens later inside res.end().

connectionWindowSize (v26.11.0; not on v24)

This is the initial connection-level flow-control window, in bytes. It is accepted by createServer, createSecureServer, and connect. Range is 1 to 2^31-1, otherwise ERR_OUT_OF_RANGE. It is visible as session.state.effectiveLocalWindowSize on the side that set it and as remoteWindowSize on the peer. The per-stream window is still settings.initialWindowSize. Per the docs (not tested here), values below 65535 only take effect after the protocol-default 65535 is used up. session.setLocalWindowSize() can raise the window immediately, but a decrease only applies as the advertised window is consumed. To get a small window from the start, use this option.

Default: the docs say 33554432 (on createSecureServer and connect). Main showed 33554432. v26.13.0 showed 65535, even though the option exists there.

response.writeInformation(status[, headers]) (v26.2.0, v24.18.0)

This is the compat API version. It sends a 1xx HEADERS frame. 101 is not allowed. After the final headers it returns false. The client sees it as a 'headers' event with :status 1xx.

Other changes in range (not exercised)

  • http2session.socket.destroy() (v26.6.0, v24.20.0) no longer throws. It destroys the session.
  • v27: when a client stream has no 'response' listener, the body is silently discarded (see the 'response' event history in the docs).

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    This skill provides technical documentation and code examples for Node.js networking APIs introduced in version 24 and later. It covers features such as port reservation, IP blocklists for SSRF protection, and HTTP/2 options. All provided examples are designed for local development and testing using loopback addresses, and no malicious patterns or data exfiltration behaviors were detected.

  • Socket5d

    No alerts

  • Snyk5d

    Risk: LOW · No issues

Signed by skilld at 5f83e6c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated last week

README badge

README badge for jasnell/node-skills/node-networking