Draft
Conversation
Member
kriszyp
commented
Apr 18, 2026
- Replace node-unix-socket native addon with native reusePort (Node v22+)
- Add BunRequest adapter wrapping Web Fetch API Request
- Branch http.ts to use Bun.serve() with fetch handler when running on Bun
- Bridge Operations API (Fastify) to Bun via inject() in bunDelegateToNodeServer
- Add listenOnPortsBun() using Bun.serve({ reusePort: true }) per worker
- Support TLS/secure ports on Bun via Bun.serve({ tls: { cert, key } })
- Create UDS mirror sockets for secure ports via Bun.serve({ unix })
- Guard Node-specific APIs: v8, inspector, worker.performance, TLS monkey-patches
- Fix performance.eventLoopUtilization() NotImplementedError on Bun
- Skip Node version check when running on Bun
- Parameterize integration tests via HARPER_RUNTIME env var (node|bun)
- Add CI jobs to run integration tests and API tests on Bun
- Replace node-unix-socket native addon with native reusePort (Node v22+)
- Add BunRequest adapter wrapping Web Fetch API Request
- Branch http.ts to use Bun.serve() with fetch handler when running on Bun
- Bridge Operations API (Fastify) to Bun via inject() in bunDelegateToNodeServer
- Add listenOnPortsBun() using Bun.serve({ reusePort: true }) per worker
- Support TLS/secure ports on Bun via Bun.serve({ tls: { cert, key } })
- Create UDS mirror sockets for secure ports via Bun.serve({ unix })
- Guard Node-specific APIs: v8, inspector, worker.performance, TLS monkey-patches
- Fix performance.eventLoopUtilization() NotImplementedError on Bun
- Skip Node version check when running on Bun
- Parameterize integration tests via HARPER_RUNTIME env var (node|bun)
- Add CI jobs to run integration tests and API tests on Bun
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Required by repo policy that all actions must be pinned to a full-length commit SHA. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 4.x-upgrade test returns early from before() when HARPER_LEGACY_VERSION_PATH is not set, leaving ctx.harper undefined. killHarper/teardownHarper now no-op gracefully in that case instead of crashing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
listenOnPortsBun() was using +port directly on keys like "127.0.0.14:9926", which produces NaN and hits the isNaN guard, skipping every port. Parse host:port strings the same way listenOnPorts() does for Node — split on the last colon and pass hostname + numeric port to Bun.serve(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On Node, Harper's httpChain auth middleware sets request._nodeRequest.user for loopback connections in dev mode (AUTHORIZE_LOCAL), which Fastify picks up via req.raw.user and bypasses its own auth check (fastifyAuth.js:35). On Bun, bunDelegateToNodeServer calls fastify.inject() with a fresh synthetic request — no req.raw.user, so Fastify re-runs auth and returns 401. Fix: strip any incoming x-harper-internal-pre-auth-user header (preventing forgery), then set it in the inject() call when Harper's auth middleware has already authenticated the request. fastifyAuth.js trusts this header as an equivalent to req.raw.user. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 'send' module (used for static files) calls setHeader/writeHead on the pipe destination. In the Bun handler, the destination must be a Writable with a ServerResponse shim so those calls capture headers into the web Response. The critical bug: 'on-finished' (a send dependency) calls isFinished() which checks msg.finished. In Bun, Writable.finished is undefined (not a boolean), so isFinished() returns undefined. Since undefined !== false, on-finished immediately schedules cleanup() via setImmediate, destroying the ReadStream before any data flows — causing the response to hang forever. Fix: add finished: false to the shim object so isFinished() sees a boolean false and correctly waits for the 'finish' event before calling cleanup(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
👀 |
…CE_EXIT` self-termination mechanism
… headers in Node.js v24+
…rove `process.exit` handling for Bun by force-closing server connections.
…to single HTTP worker - Remove socket file descriptor passing and proxying logic from http.ts and threadServer.js - Remove startSocketServer and session affinity implementation from socketRouter.ts - Remove proxySocket, proxyRequest, and deliverSocket functions - Simplify lite.js to only start HTTP threads without socket servers - Add Windows-specific CI workflow for build and integration tests - Limit Windows to single HTTP worker (no SO_REUSEPORT support) - Fix package.json test scripts to use double quotes for Windows compatibility - Disable segfault handler on Bun runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.