Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add bun support to proxy-chain

Aperta
#731 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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

low priority t-unblocking tech roadmap

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 undici to undici/index.js in vitest.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 latest instead of only latest (latest informational); add a smoke test of the built dist/ 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 servername test failures
  • Look into the flaky Invalid EOF state failure (loop the tests on Node vs Bun)
  • Try a workaround for the custom CONNECT close() hang in customConnect
  • 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 undefined from getConnectionStats() 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() returns undefined on 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apify/proxy-chain

Tutte le issue di apify/proxy-chain

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.