Add bun support to proxy-chain
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bun, node.js, typescript
- Ambito
- backend, ci-cd, devtools, documentation, testing
Direzione di ricerca
Start with vitest.config.ts, the Bun CI jobs, and the README; the issue describes the failing e2e scopes and Bun runtime limitations. Run the e2e suite on Bun with real undici, then compare results with the listed Bun bugs and Node 26 TLS failures. Done means the suite passes with documented, issue-linked skips, CI covers Bun 1.4.3 and latest, and the README lists the minimum version and known limitations.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Why
proxy-chain is used by Crawlee and by anyone running Puppeteer or Playwright through a proxy, and more of those users run on Bun now. The changelog already claims "Added Bun runtime support", but CI runs only a handful of Bun e2e tests and the README never mentions Bun. We want official Bun support: tested in CI, with the minimum version and known limitations in the README.
Context
Investigated on Bun 1.4.3 (macOS) on 2026-10-26.
The library already works on Bun. A smoke test of the built dist/ covered HTTP and CONNECT with and without auth, chaining through a second proxy, SOCKS5 upstream, anonymizeProxy, createTunnel, customConnectServer, an HTTPS server, and a clean shutdown. Every case returned 200.
Most e2e failures come from the test setup, not proxy-chain. On Bun, import 'undici' silently loads Bun's built-in version, which has no compose(), destroy() or close(). Our test HTTP client needs those.
| e2e scope | Node | Bun as configured | Bun with real undici |
|---|---|---|---|
server.ts (2168 tests) |
1752 | 340 | 1691 |
| other e2e files (40 tests) | 40 | 27 | 37 |
The 416 tests that fail on Node also fail on Bun: Node 26 rejects an IP address as the TLS servername. That is a separate test problem.
Bun bugs left (about 64 tests):
| Bug | Effect on proxy-chain | Tests | Upstream |
|---|---|---|---|
bytesRead and bytesWritten are 0 on sockets from http/https servers |
getConnectionStats() always reports srcTxBytes and srcRxBytes as 0; target-side stats are correct |
~58 | oven-sh/bun#28709, PRs #28710 and #42313 |
https.Server never emits tlsClientError |
our tlsError event never fires |
2 | PRs #46167 and #35538, no issue yet |
server.close() hangs after a CONNECT socket is handed to a second server with emit('connection') |
close() can hang when the custom CONNECT handler is used |
1 | oven-sh/bun#45095, PR #45257 |
undici HTTPParserError: Invalid EOF state |
flaky test (one of these passed when rerun), not reproduced | 1-4 | none |
The proxy keeps handling traffic in every case.
Plan
Sub-issues will track each step:
- Tests: alias
undicitoundici/index.jsinvitest.config.ts, run the full e2e suite on Bun, skip the tests hit by Bun bugs with links to the Bun issues - Tests: regenerate the expired
test/e2e/ssl.crt/ssl.key(expired 2018; Bun rejects it on the WebSocket path), taken from #663 - CI: run the Bun jobs on the minimum version (1.4.3) plus
latestinstead of onlylatest(latestinformational); add a smoke test of the builtdist/under Bun - Docs: add a Runtime support section to the README (minimum Bun version 1.4.3, version policy, known limitations); correct the changelog entry
- Separate from Bun: fix the Node 26 TLS
servernametest failures - Look into the flaky
Invalid EOF statefailure (loop the tests on Node vs Bun) - Try a workaround for the custom CONNECT
close()hang incustomConnect - Run the results on Linux (Docker or CI); everything so far ran on macOS
- Upstream: file a Bun issue for the missing
tlsClientError, post our repros on #28709 and #45095, remove each skip once its fix ships in our minimum Bun version - Decide on client byte stats on Bun: (a) document the zeros as unsupported (proposed), (b) count bytes ourselves in proxy-chain, or (c) return
undefinedfromgetConnectionStats()on Bun, as #663 does (this also hides the correct target-side stats)
Done when: the full e2e suite passes on Bun with only documented, issue-linked skips, CI passes on the minimum and latest Bun versions, and the README lists the limitations.
Prior work
- #649 (closed): early raw-socket CONNECT rewrite targeting Bun 1.3
- #663: raw-socket CONNECT rewrite, CONNECT routed from
onRequest,getConnectionStats()returnsundefinedon Bun, regenerated test certificate. On 1.4.3 only the certificate change still looks needed.
- Lingua principale
- TypeScript
- Stelle
- 1k
- Fork
- 167
- Merge medio
- 16h
- PR unite (30g)
- 9
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apify/proxy-chain
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
apify/proxy-chain#635 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
apify/proxy-chain#634 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
apify/proxy-chain#633 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue low priority t-unblocking tech roadmap
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
apify/proxy-chain#632 ·
I maintainer di solito rispondono entro 1 giorno
-
low priority t-unblocking tech roadmap
Difficoltà 3/5 Mezza giornata Idoneità per principianti 28/100
apify/proxy-chain#631 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apify/proxy-chain
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
components-web-app/docs#307 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
localstack/localstack-mcp-server#112 ·
I maintainer di solito rispondono entro 1 giorno
-
area:frontend kind:bug priority:p1 ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
PhyberApex/kuroshiro#1687 ·
I maintainer di solito rispondono entro 1 giorno
-
Performance (Web Vitals) collector: LCP/FCP from background tabs are not discarded, inflating p75Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
umami-software/umami#4720 ·
I maintainer di solito rispondono entro 3 giorni