Skip to content
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
462 commits
Select commit Hold shift + click to select a range
5c4c8bf
tls: reset a connection with unsent bytes when its thread ends
claude Nov 12, 2026
0048d8d
spawn: throw when the IPC channel cannot be opened
claude Nov 12, 2026
a8da810
socket: the callbacks of a connection outlive a connect() that replac…
claude Nov 12, 2026
fda3b09
socket: a send that fails with EPERM fails the write instead of passi…
claude Nov 12, 2026
75991fa
node:tls: a write gets its callback when the socket closes while the …
claude Nov 12, 2026
0bdf5bd
node:net: resume() starts a handle that was stopped while a read was …
claude Nov 12, 2026
9f98ecd
node:net: a socket that connected again ignores the handle of its ear…
claude Nov 12, 2026
ee81003
node:net: the timeout of a new connection doesn't count what the prev…
claude Nov 12, 2026
6347f8b
Bun.listen, Bun.connect: a dropped end(data) tail is an error for clo…
claude Nov 12, 2026
db19df7
Bun.listen, Bun.connect: wait for the peer's FIN behind the tail of e…
claude Nov 12, 2026
4a7e474
Bun.listen, Bun.connect: records that the TLS layer holds count as th…
claude Nov 12, 2026
1b934b4
node:net: declare that doConnect can return undefined
claude Nov 12, 2026
49cf0e9
node:net: fdIsWriteOnly is a private name
claude Nov 12, 2026
2f6b90f
--hot: a net.Server neither takes over an address nor gives its own up
claude Nov 12, 2026
12bef60
Bun.gc(true): finish pending compilations, which hold the values they…
claude Nov 12, 2026
afa9cd4
uws: remove the write_continue bindings that nothing calls
claude Nov 12, 2026
8f92781
socket: the callbacks are rooted from the moment the options are parsed
claude Nov 12, 2026
16e31af
node:http: a body that was whole before its first read isn't dumped u…
claude Nov 12, 2026
f3645b0
node:http: a turn without a response is null
claude Nov 12, 2026
c117e8a
aot: the connection's members have slots of their own
claude Nov 12, 2026
faa503d
node:http: a request is complete after the jobs of its last chunk, wh…
claude Nov 12, 2026
82c810b
Merge remote-tracking branch 'origin/main' into fx/h-pipe
claude Nov 12, 2026
c0d979b
fetch, sockets, node:http2, cluster, Bun.serve: fixes from review
claude Nov 12, 2026
97c1e30
aot: one test for a connection that is not known to flow
claude Nov 12, 2026
543a610
aot: the end of a body is queued under the name it has on the full road
claude Nov 12, 2026
48e3985
Merge branch 'main' into claude/http-consolidated
claude Nov 12, 2026
ba00436
tls: an SNICallback that selects nothing falls back to addContext() a…
claude Nov 12, 2026
7bafe86
process.stdin: keep Readable's destroy()
claude Nov 12, 2026
26b987e
aot: an upgrade stream takes the sockets a message takes
claude Nov 12, 2026
b21eb17
[autofix.ci] apply automated fixes
autofix-ci[bot] Nov 12, 2026
67bfc67
usockets: LIKELY and UNLIKELY compile as C++ on every libc; sockets: …
claude Nov 12, 2026
41d2b31
test: the peer of a lingering socket reads only once end() has returned
claude Nov 12, 2026
16b578b
tls: the OpenSSL default certificates compile on Windows
claude Nov 12, 2026
101d37e
trim: the readers of a body go with Bodies; Bun.serve: cold code that…
claude Nov 12, 2026
f308646
kqueue: a write to a unix peer that closed fails with EPIPE, and fetc…
claude Nov 12, 2026
b74739d
node:net: loads with any --network-family-autoselection-attempt-timeout
claude Nov 12, 2026
930f69c
test: an http2 stream listens for its reset, and the leak control out…
claude Nov 12, 2026
4eb05c1
ipc: a lost message that carries a handle is answered without an erro…
claude Nov 12, 2026
ccb768a
node:http: 'drain' waits for the CRLF that ends a large chunk
claude Nov 12, 2026
68bee65
test: the pipelining tests don't write to a closed connection, and st…
claude Nov 12, 2026
914f3eb
fetch: a stream body waits while the proxy doesn't read
claude Nov 12, 2026
f60b579
Merge main into claude/http-consolidated
claude Nov 12, 2026
5845a24
test: the parked handshakes are swept until their peers' FINs have ar…
claude Nov 12, 2026
2668561
test(aot): the process that measures a run doesn't get the environmen…
claude Nov 12, 2026
50f6e76
Merge remote-tracking branch 'origin/main' into fx/h-pipe
claude Nov 12, 2026
7a05829
Bun.serve: set-up and error paths are compiled for size, and /bun:inf…
claude Nov 12, 2026
9a3bfb0
trim: sockets, the transpiler and WebAssembly don't take node:http or…
claude Nov 12, 2026
9e655b6
node:net: a socket that is sent with a write in flight hears how the …
claude Nov 12, 2026
4b556ef
test: three checks that depended on when a collection ran or a close …
claude Nov 13, 2026
47334ee
Merge remote-tracking branch 'origin/main' into fx/h-pipe
claude Nov 13, 2026
08ef045
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 13, 2026
d373d08
SSLContextCache: lend the cache of this thread to a closure
claude Nov 13, 2026
e80e4d5
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 13, 2026
9ba1452
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 13, 2026
59b5420
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 13, 2026
96ff812
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
3d633cc
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
5b8f37a
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
252410f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
1d96bcc
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
ee8e71f
TLS servers: closing an idle connection doesn't wait for the peer's c…
claude Nov 14, 2026
2b90fee
Bun.serve: stop() waits for an idle TLS peer again, closeIdleConnecti…
claude Nov 14, 2026
2814e2c
usockets: an accept batch gets the time that the rest of the loop took
claude Nov 14, 2026
a4f92a3
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
75f069b
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
ebf298d
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
f69dc59
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
bc3f347
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
a270131
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
51230a5
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 14, 2026
a629170
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
b69b54a
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
933fd72
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
9833131
event loop: read the mini loop's uws loop before queueing a task
claude Nov 15, 2026
bba5211
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
941bebf
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
1e98cbd
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
333bd51
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
e26ce1c
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
ba30e65
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
49690b8
fetch: free a preconnect that is still in flight at exit
claude Nov 15, 2026
4b0fdd9
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
0be572f
body: remove the unused ValueError::reset
claude Nov 15, 2026
d7f4d82
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
aa13620
test: the QUIC endpoint socket does not set IP_RECVERR
claude Nov 15, 2026
4be3613
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
9114384
net: remove the poll of a write-only descriptor that stays open after…
claude Nov 15, 2026
ec73886
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
b497de3
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
2e76e6c
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
49cafda
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
277d4d9
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
2cacac9
test: ipv6Only asks the server who reached it
claude Nov 15, 2026
99e8f8f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
cfb76bd
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
4400e4d
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
a67b42b
http2: handle what a transport's write() does to the session, the str…
claude Nov 15, 2026
0702c40
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
00f200d
link: free the working directory before the arms that exit
claude Nov 15, 2026
e19f9a6
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
f92b1f5
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
9b20c23
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
10e06c3
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
114b95f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 15, 2026
bbe7f3f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
f14a608
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
d17da3b
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
d82a329
event loop: clear the dead stack before immediates run
claude Nov 16, 2026
b082977
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
aa5c836
dispatch: count the task tags of both sides of the merge
claude Nov 16, 2026
b35068c
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
7f76076
Stop only the Date allocators when the time zone changes
claude Nov 16, 2026
e48d3dd
http: parse the response head outside the generic handler
claude Nov 16, 2026
f429db3
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
6b706f0
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
ce3888f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
8baee40
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
e509eaa
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
fb46e7b
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
650eaf7
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
f1872ce
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
9b6a05f
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
d5d7fa6
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
b4a771c
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
8abceee
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
75dd749
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
2dda4e6
http: an empty text/event-stream response is complete at its head
claude Nov 16, 2026
50ee095
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
5fbbe4b
test: run the writeHead termination fixture until it has seen each case
claude Nov 16, 2026
9a4926b
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
81065d9
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
70f1b94
windows_sys: remove unused AF_UNIX
claude Nov 16, 2026
664b393
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 16, 2026
744a7f3
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
0b81a8e
test(http2): wait for the server session's close even if a reset come…
claude Nov 17, 2026
0913207
ci: retry the fetch of a vendored test suite
claude Nov 17, 2026
2f8dd4c
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
8a94bf1
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
cf92e0a
fetch: a request id that does not wrap
claude Nov 17, 2026
eb5d12d
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
ba9ad6e
ci: job limit of 60 minutes for the Linux asan test lane, 45 for Ubuntu
claude Nov 17, 2026
b38af39
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
669791b
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
17982b1
net: a closing server emits 'close' once its last socket is sent to a…
claude Nov 17, 2026
6941478
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
5d8c9ab
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
cba8c81
net: what blockList.check() or a 'drop' listener throws on a TLS serv…
claude Nov 17, 2026
a1e2081
http2: frames queued by a promise job of the transport's write() go o…
claude Nov 17, 2026
a83f07a
http2: settings() and ping() callbacks are queued in the order of the…
claude Nov 17, 2026
587055a
http2: a push stops counting toward maxReservedRemoteStreams when it …
claude Nov 17, 2026
0f2a300
http2: session.destroy() emits 'close' on unread client streams that …
claude Nov 17, 2026
2fd60b9
http2: an answer that arrives inside the transport's write() waits un…
claude Nov 17, 2026
4fa3a08
http2: a server refuses its pushes above the last stream id of a GOAWAY
claude Nov 17, 2026
f18fee5
http2: a push that crosses settings({ enablePush: false }) is cancell…
claude Nov 17, 2026
c797c8e
http2: a session reads a socket that was handed over paused
claude Nov 17, 2026
b395d3c
http2: a transport written in JS gets no more bytes until its 'drain'
claude Nov 17, 2026
c6fcc96
http2: a request that is destroyed before it is submitted calls back …
claude Nov 17, 2026
b6b528b
http2: no DATA follows response headers that end the stream
claude Nov 17, 2026
8478e7e
http2: pushStream() calls back with an error when its stream is alrea…
claude Nov 17, 2026
3d0e04d
tls: a Worker can end inside an ALPNCallback
claude Nov 17, 2026
a9f8b3d
tls: a context selected by server name has the server's ciphers and s…
claude Nov 17, 2026
d8ebaab
fetch: HTTP/3 matches certificate names like the other TLS clients
claude Nov 17, 2026
bcf4705
tls: a TLSSocket over a stream can answer after the peer's close_notify
claude Nov 17, 2026
cbc463c
tls: sigalgs covers every key of a context that has several
claude Nov 17, 2026
ab3aa7f
http: an Agent drops an idle socket with allowHalfOpen that the serve…
claude Nov 17, 2026
44feb16
tls: a client takes no servername from the options of its secureContext
claude Nov 17, 2026
2017f45
test: fetch tests dial the address their server listens on
claude Nov 17, 2026
7be8b4d
fetch: an idempotent request is sent again when the origin closes a r…
claude Nov 17, 2026
c83ee3c
fetch: a response whose reader released its lock gives its request sl…
claude Nov 17, 2026
44a996f
fetch: an HTTP/2 or HTTP/3 stream gets no more window while its compr…
claude Nov 17, 2026
8b55ba5
fetch: the HTTP/2 idle timeout does not run while every response wait…
claude Nov 17, 2026
6da816d
node-fetch: the getters of an init whose body or tls is replaced run …
claude Nov 17, 2026
35d0c96
fetch: a response through a CONNECT proxy stops being read while its …
claude Nov 17, 2026
7299b9a
Bun.serve: a request with a paused body aborts when its response find…
claude Nov 17, 2026
d45e26e
Bun.serve: a socket stays allocated while a corked handler runs the e…
claude Nov 17, 2026
19e1cbc
usockets: a read under a handler that runs the event loop gets a buff…
claude Nov 17, 2026
e6fa2ba
Bun.serve: HTTP/2 frames that arrive while a handler runs the event l…
claude Nov 17, 2026
4d9085c
net: a socket sent to a child leaves the count of the server that acc…
claude Nov 17, 2026
5a8a5ee
child_process: send() closes the socket when its message can't be ser…
claude Nov 17, 2026
53db9e0
cluster: disconnect() closes an http server that listened again befor…
claude Nov 17, 2026
47b6e15
cluster: an http worker binds a port after the primary has let go of it
claude Nov 17, 2026
3012643
cluster: a worker drops a connection that it can't adopt instead of t…
claude Nov 17, 2026
2cc6019
cluster: a worker that disconnects before the primary answered its li…
claude Nov 17, 2026
ef649fd
net: ref() doesn't keep the process alive for a socket with nothing t…
claude Nov 17, 2026
d42d22c
socket: a timeout that fires while connecting leaves the handlers in …
claude Nov 17, 2026
d6cc3ef
node:http: the stand-in socket of a ServerResponse emits 'finish' and…
claude Nov 17, 2026
edb97b2
node:http: a socket that ends finishes behind the response bytes that…
claude Nov 17, 2026
07f0395
node:http: destroy() after end() closes a connection whose peer doesn…
claude Nov 17, 2026
378c654
node:http: a paused socket closes when end() and the peer's FIN have …
claude Nov 17, 2026
d1fa467
node:https: the peer's FIN leaves the responses that are owed to the …
claude Nov 17, 2026
6d35223
node:http: the stream of an Upgrade request with a body closes with n…
claude Nov 17, 2026
1079f4f
node:http: a ServerResponse made in an 'upgrade' listener writes to t…
claude Nov 17, 2026
eb31584
node:http: a pipelined Upgrade request with a body goes to 'upgrade'
claude Nov 17, 2026
f6a72ab
node:http: a reader added behind socket.removeAllListeners() gets the…
claude Nov 17, 2026
4bc6694
test: the record of a server socket's replaced methods has the isPaus…
claude Nov 17, 2026
8254f22
node:http: a reader added while a server's socket is paused gets the …
claude Nov 17, 2026
0c78ee7
http2: only a write() that returns false is backpressure; a long name…
claude Nov 17, 2026
6357a3e
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
46ddd31
http server: what a parse knows about its upgrade belongs to that parse
claude Nov 17, 2026
3f99bfa
fetch: the idle deadline doesn't fire for a body that was paused afte…
claude Nov 17, 2026
7276847
http2: writes of a request destroyed before it was submitted fail; un…
claude Nov 17, 2026
c95a1ed
socket: a named pipe that times out while connecting keeps its handle…
claude Nov 17, 2026
4e92d7f
node:http: a pipelined Upgrade request with a body is answered as a r…
claude Nov 17, 2026
4046b73
quic: a stream that is told to stop sending behind an unacknowledged …
claude Nov 17, 2026
a90a60b
http server: a read that ends right behind the target "http://" waits…
claude Nov 17, 2026
f67c75c
quic: a session ticket is offered only with the TLS options it was is…
claude Nov 17, 2026
cea486f
redis: tls.checkServerIdentity is called
claude Nov 17, 2026
d5030bd
node:http: a reader added to a paused server socket leaves the pause …
claude Nov 17, 2026
cdd7c35
node:http: the parser finishes the read it is in when the program tak…
claude Nov 17, 2026
c3d181e
node:http: the peer's FIN closes a connection with a 'data' listener …
claude Nov 17, 2026
cbb28e5
node:http: socket.end() on a paused upload keeps what the next read b…
claude Nov 17, 2026
c2180df
cluster: an http worker whose bind waits for the primary listens once
claude Nov 17, 2026
14aea5a
node:http: a response whose socket is destroyed under its last write …
claude Nov 17, 2026
bf55722
node:http: a response on an emitted stream emits no 'finish' behind i…
claude Nov 17, 2026
ef355f8
node:http: a socket that ended closes on the responses that wait behi…
claude Nov 17, 2026
00d5e2b
node:http: flushHeaders() on a response that is over doesn't throw
claude Nov 17, 2026
0fe5c15
node:http: reads of a partial request head restart the socket's timeout
claude Nov 17, 2026
3bdece9
node:https: a response sends nothing behind socket.end(data)
claude Nov 17, 2026
44d8449
test: the record of a server's and a server socket's reads follows li…
claude Nov 17, 2026
334c9ba
net: a write in flight keeps the process alive on a socket that was u…
claude Nov 17, 2026
ab481f2
ws: the getters of the tls and proxy options run on the object that w…
claude Nov 17, 2026
3145356
node:http: a response lets go of its connection when a listener repla…
claude Nov 17, 2026
1b4d04b
node:http: a response whose listener upgraded to a WebSocket closes w…
claude Nov 17, 2026
bb327e0
node:http: writableFinished turns true on a socket stand-in that has …
claude Nov 17, 2026
3acfe8f
tls: a TLSSocket over a stream finishes after the stream took what wa…
claude Nov 17, 2026
3d32b16
tls: a context selected by server name keeps the ciphers and sigalgs …
claude Nov 17, 2026
80cb750
redis: tls.checkServerIdentity is read like the SQL drivers read it
claude Nov 17, 2026
361c083
fetch: a paused HTTP/2 body doesn't lift the deadline of a liveness PING
claude Nov 17, 2026
f6bb644
node:http: the parser lets go of a socket whose reads were taken, als…
claude Nov 17, 2026
f81fc45
node:http: socket writes keep their order on https; end() doesn't res…
claude Nov 17, 2026
89d9820
Merge remote-tracking branch 'origin/main' into claude/http-consolidated
claude Nov 17, 2026
df4ad7f
node:https: only the sockets that share their writes carry the mark
claude Nov 17, 2026
4e8bb2c
node:http: closeIdleConnections() keeps an emitted connection whose l…
claude Nov 17, 2026
ff765e5
http2: the bindings of ping() and settings() say that they change the…
claude Nov 17, 2026
ed16a14
http2: the bindings describe the push onto that queue
claude Nov 17, 2026
28f768e
node:http: read the length of the waiting responses once
claude Nov 17, 2026
ad84069
node:http: removeAllListeners() is a server socket's own, and listen(…
claude Nov 17, 2026
57c6fe3
node:http: closeIdleConnections() asks the socket for its parser, and…
claude Nov 17, 2026
915f5ef
test: the constructor of Bun.RedisClient makes its object itself
claude Nov 17, 2026
f8086a0
test: two tests no longer depend on how Windows sends and collects ev…
claude Nov 17, 2026
6dd2b31
Merge branch 'main' into claude/http-consolidated
claude Nov 17, 2026
562990e
Merge branch 'main' into claude/http-consolidated
claude Nov 17, 2026
ff93c73
Bun.serve: HEAD and 304 don't cancel a rewrite whose input is over
claude Nov 17, 2026
50113c5
streams: that question to the rewriter is behind its handle, so Bun.s…
claude Nov 17, 2026
0b74d19
test: that TLS write always leaves plaintext for the writable event
claude Nov 18, 2026
2defaa8
Merge branch 'main' into claude/http-consolidated
claude Nov 18, 2026
1d6c5ef
Merge branch 'main' into claude/http-consolidated
claude Nov 18, 2026
069ffed
event loop: stop clearing the dead stack before immediates run
claude Nov 18, 2026
3849dda
Merge branch 'main' into claude/http-consolidated
claude Nov 18, 2026
901671c
Merge branch 'main' into claude/http-consolidated
claude Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions docs/bundler/executables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -800,12 +800,10 @@ import styles from "./styles.css" with { type: "file" };
import { file, serve } from "bun";

serve({
// Inside the compiled executable, file() on an embedded path returns an
// in-memory Blob, which routes only accepts wrapped in a Response.
routes: {
"/favicon.ico": new Response(file(favicon)),
"/logo.png": new Response(file(logo)),
"/styles.css": new Response(file(styles)),
"/favicon.ico": file(favicon),
"/logo.png": file(logo),
"/styles.css": file(styles),
},
fetch(req) {
return new Response("Not found", { status: 404 });
Expand Down Expand Up @@ -988,12 +986,11 @@ import "./public/styles.css" with { type: "file" };
import { embeddedFiles, serve } from "bun";

// Build static routes from all embedded files
const staticRoutes: Record<string, Response> = {};
const staticRoutes: Record<string, Blob> = {};
for (const blob of embeddedFiles) {
// Remove hash from filename: "icon-a1b2c3d4.png" -> "icon.png"
const name = blob.name.replace(/-[a-z0-9]+\./, ".");
// embeddedFiles are plain Blobs, which routes does not accept directly
staticRoutes[`/${name}`] = new Response(blob);
staticRoutes[`/${name}`] = blob;
}

serve({
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/http/fetch-unix.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: fetch with unix domain sockets in Bun
sidebarTitle: Fetch with unix domain sockets
title: fetch with Unix domain sockets in Bun
sidebarTitle: Fetch with Unix domain sockets
mode: center
---

In Bun, `fetch()` can send HTTP requests over a [unix domain socket](https://en.wikipedia.org/wiki/Unix_domain_socket) with the `unix` option.
In Bun, `fetch()` can send HTTP requests over a [Unix domain socket](https://en.wikipedia.org/wiki/Unix_domain_socket) with the `unix` option.

```ts fetch-unix.ts icon="/icons/typescript.svg"
const unix = "/var/run/docker.sock";
Expand All @@ -17,9 +17,9 @@ console.log(body); // { ... }

---

The `unix` option is the local file path to a unix domain socket. `fetch()` sends the request over that socket instead of a TCP connection. HTTPS is also supported: use the `https://` protocol in the URL instead of `http://`.
The `unix` option is the local file path to a Unix domain socket. `fetch()` sends the request over that socket instead of a TCP connection. HTTPS is also supported: use the `https://` protocol in the URL instead of `http://`.

To send a `POST` request to an API endpoint over a unix domain socket:
To send a `POST` request to an API endpoint over a Unix domain socket:

```ts fetch-unix.ts icon="/icons/typescript.svg"
const response = await fetch("https://hostname/a/path", {
Expand Down
15 changes: 13 additions & 2 deletions docs/guides/http/stream-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,28 @@ new Response(Bun.file("./img.png")).headers.get("Content-Type");

Putting it all together with [`Bun.serve()`](/runtime/http/server).

The client chooses the request path, and `new URL(req.url).pathname` starts with `/`. Passing it straight to `Bun.file()` would serve any file the process can read. Resolve it against a fixed directory and reject anything outside that directory.

```ts server.ts icon="/icons/typescript.svg"
import path from "node:path";

const root = path.resolve("./public");

// static file server
Bun.serve({
async fetch(req) {
const path = new URL(req.url).pathname;
const file = Bun.file(path);
const filePath = path.join(root, decodeURIComponent(new URL(req.url).pathname));
if (!filePath.startsWith(root + path.sep)) return new Response("Forbidden", { status: 403 });
Comment thread
Jarred-Sumner marked this conversation as resolved.
Resolved

const file = Bun.file(filePath);
if (!(await file.exists())) return new Response("Not Found", { status: 404 });
return new Response(file);
},
});
```

To serve a whole directory without writing this yourself, use a [directory route](/runtime/http/routing#directory-routes).

---

See [`Bun.write()`](/runtime/file-io#writing-files-bun-write).
4 changes: 3 additions & 1 deletion docs/runtime/debugger.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ await fetch("https://example.com", {
```

```txt
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.3.3" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
[fetch] $ curl --http1.1 'https://example.com/' -X POST -H 'content-type: application/json' -H 'Connection: keep-alive' -H 'User-Agent: Bun/1.3.3' -H 'Accept: */*' -H 'Host: example.com' -H 'Accept-Encoding: gzip, deflate, br' --compressed -H 'Content-Length: 13' --data-raw '{"foo":"bar"}'
[fetch] > HTTP/1.1 POST https://example.com/
[fetch] > content-type: application/json
[fetch] > Connection: keep-alive
Expand All @@ -169,6 +169,8 @@ await fetch("https://example.com", {

The lines with `[fetch] >` are the request from your local code, and the lines with `[fetch] <` are the response from the remote server.

On macOS and Linux, each argument of the `curl` command is single-quoted, so a shell like `bash` or `zsh` passes `$`, backticks and double quotes to `curl` as they are. On Windows, the arguments are double-quoted for `cmd.exe`.

To print without the `curl` command, set `BUN_CONFIG_VERBOSE_FETCH` to `true`.

```ts index.ts icon="/icons/typescript.svg"
Expand Down
1 change: 1 addition & 0 deletions docs/runtime/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ Bun reads these environment variables to configure aspects of its behavior.
| `NO_COLOR` | If `NO_COLOR=1`, then ANSI color output is [disabled](https://no-color.org/). |
| `FORCE_COLOR` | If `FORCE_COLOR=1`, then ANSI color output is forced on, even if `NO_COLOR` is set. |
| `BUN_CONFIG_MAX_HTTP_REQUESTS` | Sets the maximum number of concurrent HTTP requests sent by `fetch` and `bun install`. `fetch` defaults to `256`. `bun install` defaults to `64`, and its `--network-concurrency` flag overrides this variable. Lower it if you run into rate limits or connection issues. |
| `BUN_CONFIG_HTTP_IDLE_TIMEOUT` | Seconds an HTTP request sent by `fetch` or `bun install` can go without progress before it fails with a timeout error. The timer covers the TLS handshake, the response headers and the response body. Defaults to `300`. `0` disables it. |
| `BUN_INSTALL_WINDOWS_RENAME_RETRY_MS` | Windows only. How many milliseconds `bun install` keeps retrying a rename that fails because another process, usually antivirus, has a file in the directory open. Defaults to `5000`. |
| `BUN_CONFIG_WS_CLOSE_TIMEOUT` | Sets how many seconds a `WebSocket` client waits after sending a Close frame for the server to reply and close the connection. After that, Bun closes it. If the server never sent a Close frame, the `close` event has code `1006`. Defaults to `30`. `0` disables the timeout. |
| `BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD` | If `BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD=true`, then `bun --watch` does not clear the console on reload |
Expand Down
9 changes: 8 additions & 1 deletion docs/runtime/http/error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ In development mode, when a request handler throws and no `error` handler return

To handle server-side errors, implement an `error` handler. Return a `Response` to serve to the client when an error occurs. In `development` mode, this response replaces Bun's default error page.

Error messages and stack traces can contain request input and absolute file paths. Escape them with [`Bun.escapeHTML()`](/runtime/utils#bun-escapehtml) before you put them in HTML, and don't send them to clients in production.

```ts
Bun.serve({
fetch(req) {
throw new Error("woops!");
},
error(error) {
return new Response(`<pre>${error}\n${error.stack}</pre>`, {
console.error(error);
if (process.env.NODE_ENV === "production") {
return new Response("Internal Server Error", { status: 500 });
}
return new Response(`<pre>${Bun.escapeHTML(`${error}\n${error.stack}`)}</pre>`, {
status: 500,
headers: {
"Content-Type": "text/html",
},
Expand Down
26 changes: 18 additions & 8 deletions docs/runtime/http/routing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ Bun.serve({
});
```

Bun automatically decodes percent-encoded route parameter values, including Unicode characters. Bun replaces invalid Unicode with the Unicode replacement character (`\uFFFD`).
A path segment is a parameter only when it starts with `:`, and the parameter captures the whole segment. A `:` anywhere else in a segment is matched literally, so `/files:batchGet/:id` has one parameter, `id`.

Bun automatically decodes percent-encoded route parameter values, including Unicode characters. Bun replaces invalid Unicode with the Unicode replacement character (`\uFFFD`). A `%` that isn't followed by two hexadecimal digits stays a literal `%`.

### Static responses

Expand Down Expand Up @@ -163,10 +165,14 @@ Bun caches static route responses for the lifetime of the server object. To relo
Serving a file from a route behaves differently depending on whether you buffer the file content or serve it directly:

```ts
const logo = Bun.file("./logo.png");

Bun.serve({
routes: {
// Static route - content is buffered in memory at startup
"/logo.png": new Response(await Bun.file("./logo.png").bytes()),
"/logo.png": new Response(await logo.bytes(), {
headers: { "Content-Type": logo.type },
}),

// File route - content is read from filesystem on each request
"/download.zip": new Response(Bun.file("./download.zip")),
Expand All @@ -181,6 +187,7 @@ Bun.serve({
- **If-None-Match** - Returns `304 Not Modified` when client ETag matches
- **No 404 handling** - Missing files cause startup errors, not runtime 404s
- **Memory usage** - Full file content stored in RAM
- **No Content-Type** - Bytes have no type, so set the `Content-Type` header yourself. `file.type` is the type Bun infers from the file extension
- **Best for**: Small static assets, API responses, frequently accessed files

**File routes** (`new Response(Bun.file(path))`) read from filesystem per request:
Expand All @@ -207,7 +214,9 @@ Bun.serve({
});
```

Bun percent-decodes the part of the request URL after the prefix once and opens it relative to `dir`. Bun rejects non-canonical paths with `404`, so the served path is always the path the router matched. A path is non-canonical if it contains `.`, `..`, empty segments, `%2F`, or a `%XX` sequence encoding a character that may appear literally in a path segment. On Linux the open uses `openat2(RESOLVE_IN_ROOT)`, so the kernel clamps symlinks that would escape `dir`.
Bun percent-decodes the part of the request URL after the prefix once and opens it relative to `dir`. Bun rejects non-canonical paths with `404`, so the served path is always the path the router matched. A path is non-canonical if it contains a segment that is exactly `.` or `..`, an empty segment, `%2F`, or a `%XX` sequence encoding a character that may appear literally in a path segment. On Linux the open uses `openat2(RESOLVE_IN_ROOT)`, so the kernel clamps symlinks that would escape `dir`. On macOS and Windows, and on Linux when `openat2` is unavailable (kernels before 5.6, or a seccomp policy that blocks it), Bun follows symlinks, so a symlink inside `dir` exposes its target even when the target is outside `dir`.

Bun doesn't filter dotfiles. It serves any regular file under `dir`, including a `.env` file or the contents of a `.git` directory. Point `dir` at a directory that only contains public files.

<Info>
Routing is case-sensitive, but filesystems on macOS and Windows are case-insensitive by default. As a result, a
Expand Down Expand Up @@ -252,15 +261,16 @@ Bun.serve({
fetch(req) {
// parse `Range` header
const [start = 0, end = Infinity] = req.headers
.get("Range") // Range: bytes=0-100
.split("=") // ["Range: bytes", "0-100"]
.get("Range") // "bytes=0-100"
.split("=") // ["bytes", "0-100"]
.at(-1) // "0-100"
.split("-") // ["0", "100"]
.map(Number); // [0, 100]
.split("-") // ["0", "100"], or ["100", ""] for "bytes=100-"
.map(part => (part ? Number(part) : undefined)); // [0, 100]

// return a slice of the file
// the end of a `Range` is inclusive and the end of a `slice` is exclusive, so add 1
const bigFile = Bun.file("./big-video.mp4");
return new Response(bigFile.slice(start, end));
return new Response(bigFile.slice(start, end + 1));
},
});
```
Expand Down
58 changes: 52 additions & 6 deletions docs/runtime/http/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,48 @@ const server = Bun.serve({
console.log(`Server running at ${server.url}`);
```

### Splitting routes across files

`routes` is a plain object, so you can define groups of routes in separate files and spread them together. Annotate `req` with `BunRequest<path>` to keep `req.params` typed.

```ts title="users.ts" icon="/icons/typescript.svg"
import type { BunRequest } from "bun";

export const userRoutes = {
"/users/:id": (req: BunRequest<"/users/:id">) => {
return new Response(`Hello User ${req.params.id}!`);
},
};
```

```ts title="posts.ts" icon="/icons/typescript.svg"
export const postRoutes = {
"/api/posts": {
GET: () => new Response("List posts"),
POST: async (req: Request) => {
const post = await req.json();
return Response.json({ created: true, post });
},
},
};
```

```ts title="index.ts" icon="/icons/typescript.svg"
import { userRoutes } from "./users";
import { postRoutes } from "./posts";

const server = Bun.serve({
routes: {
...userRoutes,
...postRoutes,
},

fetch(req) {
return new Response("Not Found", { status: 404 });
},
});
```

---

## HTML imports
Expand Down Expand Up @@ -147,7 +189,7 @@ NODE_PORT=4002 bun server.ts

## Unix domain sockets

To listen on a [unix domain socket](https://en.wikipedia.org/wiki/Unix_domain_socket), pass the `unix` option with the path to the socket.
To listen on a [Unix domain socket](https://en.wikipedia.org/wiki/Unix_domain_socket), pass the `unix` option with the path to the socket.

```ts
Bun.serve({
Expand All @@ -171,7 +213,7 @@ Bun.serve({
});
```

Unlike unix domain sockets, abstract namespace sockets are not bound to the filesystem and are automatically removed when the last reference to the socket is closed.
Unlike Unix domain sockets, abstract namespace sockets are not bound to the filesystem and are automatically removed when the last reference to the socket is closed.

---

Expand Down Expand Up @@ -213,7 +255,7 @@ Bun.serve({
```

<Note>
`http3` is not supported with unix domain sockets: QUIC requires a UDP port. `http1: false` requires `http2: true` or
`http3` is not supported with Unix domain sockets: QUIC requires a UDP port. `http1: false` requires `http2: true` or
`http3: true`.
</Note>

Expand Down Expand Up @@ -252,7 +294,7 @@ Set `http1: false` to refuse HTTP/1.x clients. Over TLS, clients that offer ALPN

By default, `Bun.serve` closes connections after **10 seconds** of inactivity. A connection is idle when no data is being sent or received. That includes in-flight requests where your handler is still running but hasn't written any bytes to the response yet. Browsers and `fetch()` clients see this as a connection reset.

To configure this, set the `idleTimeout` field (in seconds). The maximum value is `255`, and `0` disables the timeout entirely.
To configure this, set the `idleTimeout` field (in seconds). The maximum value is `255`, and `0` disables the timeout entirely. Bun checks for idle connections every 4 seconds, so a connection is closed up to 4 seconds after its `idleTimeout` has passed, and never before.

```ts
Bun.serve({
Expand All @@ -265,6 +307,8 @@ Bun.serve({
});
```

`idleTimeout` is also how long Bun keeps an idle keep-alive connection open between requests. Behind a load balancer or a reverse proxy, set it above the keep-alive time the proxy uses for its upstream connections, or to `0`. Otherwise the proxy can send a request on a connection that Bun is closing.

<Note>
**Streaming & Server-Sent Events** — The idle timer applies while a response is being streamed. If your stream goes
quiet for longer than `idleTimeout`, Bun closes the connection mid-response. For long-lived streams, disable the
Expand Down Expand Up @@ -336,6 +380,8 @@ await server.stop(true);

By default, `stop()` allows in-flight requests and WebSocket connections to complete. The server closes idle keep-alive connections immediately. Connections with a request in flight close once the server has sent their response. Pass `true` to immediately terminate all connections instead. Open WebSockets close with code `1001`. The returned promise resolves once every connection has closed.

The last HTTP/1.1 response on a connection carries `Connection: close`. An HTTP/2 connection gets a `GOAWAY` frame, and once its streams are done the server ends its side of the connection. The connection closes when the client ends its side too, or after 10 seconds.

### `server.closeIdleConnections()`

To close keep-alive connections that are not currently serving a request, without stopping the server:
Expand Down Expand Up @@ -392,7 +438,7 @@ Use this for development and hot reloading. You can update only `fetch`, `error`

### `server.timeout(Request, seconds)`

Override the idle timeout for an individual request. Pass `0` to disable the timeout entirely for that request.
Override the idle timeout for an individual request. Pass `0` to disable the timeout entirely for that request. The maximum is `255`, and larger values are clamped to it.

```ts
const server = Bun.serve({
Expand Down Expand Up @@ -621,7 +667,7 @@ interface Server extends Disposable {
* Make a request to the running server.
* Useful for testing or internal routing.
*/
fetch(request: Request | string): Response | Promise<Response>;
fetch(request: Request | string | URL, init?: RequestInit): Response | Promise<Response>;

/**
* Upgrade an HTTP request to a WebSocket connection.
Expand Down
16 changes: 16 additions & 0 deletions docs/runtime/http/tls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ Bun.serve({
});
```

### Protocol versions

To limit the TLS protocol versions a connection can use, set `minVersion` and `maxVersion`. They take the same names as `node:tls`: `"TLSv1"`, `"TLSv1.1"`, `"TLSv1.2"` and `"TLSv1.3"`. The defaults are `"TLSv1.2"` and `"TLSv1.3"`.

```ts
Bun.serve({
tls: {
key: Bun.file("./key.pem"),
cert: Bun.file("./cert.pem"),
minVersion: "TLSv1.3", // [!code ++]
},
});
```

The same two options work in every API that takes a `tls` object, such as `fetch`, `Bun.connect` and `Bun.listen`. When `tls` is an array (see [SNI](#server-name-indication-sni) below), every entry uses the range of the first one.

### CA Certificates

Pass `ca` to override the trusted CA certificates. By default, the server trusts the list of well-known CAs curated by Mozilla; setting `ca` replaces that list.
Expand Down
Loading
Loading