nodejitsu/node-http-proxy — pull request #706 by thlorenz (2014-09-29 02:48:27+00:00)
Title: exposing proxySocket on socket to support sniffing messages coming from proxy target

Basically I need access to the proxySocket in order to listen to messages coming back.

I realize the implementation is a bit hacky, but it's the only way I could think of ATM. I'm open for other suggestions.

Here is an example use case taken from [chromium-remote-debugging-proxy](https://github.com/thlorenz/chromium-remote-debugging-proxy/blob/792e92a1fe3f8035dd6f78504c2d5880756ce340/index.js#L85-L89)

```js
socket.on('data', function ondata(data) {
if (socket.proxySocket) {
socket.proxySocket.on('data', function ondata(data) {
retHybi.parse(data)
})
socket.proxySocket = undefined;
}
})
```

If there is an existing way to make this work, please let me know as well.