substack/bouncy — Issue #5: keep-alive is broken
Author: substack
Created: 2011-10-12 12:58:20+00:00
State: open

`Connection: keep-alive` streams can actually bleed into one another:
https://github.com/substack/bouncy/blob/master/test/keep_alive_leak.js

The fix for this is probably to drop the `c.on('data', fn)` in `bounce()` so that there is only one `c.on('data', fn)` in the whole program. Use a combination of `onIncoming` timing and `ret` offsets to divert the stream output and buffering among the `bounce()` streams correctly.

Ideally add a hook to `opts` so that keep-alive streams can be kept alive between requests either individually or with a connection pool.