-
v2.18.0
StableAll checks were successfulrelease / build-and-release (push) Successful in 21sreleased this
2026-11-07 05:07:17 +00:00 | 77 commits to main since this releaseNOE v2.18.0
This release adds raw TLS streams and UDP datagram sockets to
noe:sockets.
Both reuse the existing native resource ownership and execution/Worker cleanup.
No dependency changes are required. HTTPS/WSS listeners remain available
throughnoe:http, as introduced in v2.17.0.Raw TLS streams
Use
network: "tls"withconnectandlisten. Connections retain the
existingreadable,writable,close, and asynchronous-disposal interface.
Connect and accept return only after their TLS handshake succeeds.import {readFile} from "noe:fs"; import {connect, listen} from "noe:sockets"; const cert = await readFile("server-cert.pem", "utf8"); const key = await readFile("server-key.pem", "utf8"); await using listener = await listen({ network: "tls", host: "127.0.0.1", port: 0, cert, key, }); const accepting = listener.accept(); await using client = await connect({ ...listener.address, ca: cert, }); await using server = await accepting; // Exchange bytes through client/server readable and writable Web Streams.Start accept before awaiting a loopback client so the server can complete its
handshake. The example identity must include IP:127.0.0.1 in its certificate
subject alternative names. See the
complete TLS round-trip example.Clients verify the certificate chain and hostname using system roots by
default. OptionalcaPEM replaces roots for that connection;serverName
selects the verification name. Optional clientcert/keyenables a client
identity. Listeners require a matching PEM pair or Go host configuration.
Invalid or conflicting settings reject before dial/bind without exposing PEM
material. Values contain PEM text, not implicit file paths; explicit file reads
remain under the selectednoe:fscapability and its Root/Cwd/ReadOnly policy.writer.close()sends TLS close_notify and leaves reads available. Reader
cancellation stops local delivery without waiting behind TLS protocol-alert
writes; the connection retains that native work until full close. Writer abort
and full close interrupt transport operations without waiting for a graceful
alert. Listener close cancels pending handshakes and undelivered results;
connections already returned retain independent ownership.Go TLS configuration and compatibility
Keep selecting
Modules.RawSockets: true. New
Modules.RawSocketsTLS *stdlib.SocketTLSOptionsconfigures Client and Server
*tls.Configvalues plus HandshakeTimeout, without granting sockets by itself.
A non-nil direction configuration is authoritative; corresponding inline
JavaScript TLS fields cannot override it. Raw TLS preserves host ALPN choices.
HTTP/Fetch/WebSocket trust and capabilities remain independent.profile.Modules = stdlib.Modules{ RawSockets: true, RawSocketsTLS: &stdlib.SocketTLSOptions{ Client: &tls.Config{RootCAs: roots}, Server: &tls.Config{Certificates: []tls.Certificate{certificate}}, }, }This fragment uses
crypto/tlsand previously loaded roots/certificate material.
Configuration copies are cloned for profiles, runtimes, Workers, and listeners.
Referenced keys, pools, caches, and callbacks retain Go's immutable-in-use
ownership. The handshake timer defaults to ten seconds; positive values
override it, and a negative value disables it. Owner cancellation stays active.Go source compatibility: the additional
Modulesfield requires external
unkeyed struct literals to move to named fields. Existing keyed selections and
the public/v2module path remain supported. See the
raw TLS contract.UDP datagrams
New
bindcreates an owned UDP socket with explicit packet operations. Stream
connect/listen return types remain unchanged.import {bind} from "noe:sockets"; await using receiver = await bind({network: "udp", host: "127.0.0.1", port: 0}); await using sender = await bind({network: "udp", host: "127.0.0.1", port: 0}); const receiving = receiver.receive(); await sender.send(new Uint8Array([0, 128, 255]), receiver.address); const {data, remoteAddress} = await receiving; console.log([...data], remoteAddress);One send/receive handles one packet, including an empty datagram. Send snapshots
Uint8Array bytes before asynchronous work and returns the local OS byte count.
Receive returns fresh bytes and the sender's{network: "udp", host, port}.
Host resolution supports IPv4/IPv6. OS routing/size failures reject. A 65,536-byte
receive buffer accommodates ordinary UDP; read errors and full buffers reject
instead of exposing a possible partial payload. UDP adds no delivery, order,
duplicate suppression, or retry guarantee.Bind/send/receive accept operation-scoped AbortSignal and preserve its exact
reason. Canceling one operation does not disturb another. Bind signal ownership
ends at return; cancellation cannot withdraw a packet already accepted by the
OS and may discard an already received packet.close()returns one shared
Promise, cancels pending operations, and releases native I/O. Async
disposal and runtime/Worker teardown use the same ownership model.UDP uses the existing RawSockets grant, with no new Go option or implicit
FS/HTTP/WebSocket capability. See the
UDP round-trip example
and UDP contract.Verification and distribution
Implementation verification covers trust/hostname/mTLS, host configuration
snapshots, scoped cancellation/deadline reset, queued result ownership,
blocked I/O, Worker/runtime cleanup, UDP packet boundaries/addresses, IPv6,
types, CLI examples, and standalone public Go consumers. Affected race checks,
vet, and bounded reviews pass. Consumers build with CGO disabled for all six
release targets. Release preparation reuses unchanged implementation evidence.Generated
dist/is now ignored by Git, so earlier CI build outputs no longer
mark later binaries' VCS metadata dirty. CI builds six distribution binaries,
creates SHA256SUMS, and publishes the immutable tag without repeating local
source suites. Native execution is Linux amd64; other targets receive
build/checksum verification. Go 1.27.2, go-quickjs v0.32.0, go-intl v0.8.0,
and disabled JIT remain selected.Release requests include verified local installation at both executable paths.
Running-service restarts and noebot changes remain separate. See the
release checkpoints for publication and installation
evidence.Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
0 downloads
-
Source code (ZIP)