i don'T know for sure, but from the stacktrace: could it be possible, that 
the proxy module write some headers already, and then your code in the 
proxyError event handler again?

Am Samstag, 8. März 2014 04:16:29 UTC+1 schrieb ming:
>
> Hi,
> i've been running a reverse proxy (with the http-proxy module) on Node.js 
> 0.10.24 for a while after i migrated from 0.8.22.    To my surprise, i 
> again ran into the annoying 
>    Error: Can't render headers after they are sent to the client.
> so my Node.js server crashed (complete stack trace below in <1>):
>
> According to ChangeLog of 0.9.3 at
>    http://nodejs.org/changelog.html 
> there is the following:
>    http: add response.headersSent property (Pavel Lang) 
>
> Should this error be squashed after 0.9.3 release with the headersSent 
> check?   What am i missing?
>
> <1>
> ---------------------------------------------------------------
>   Error: Can't render headers after they are sent to the client.
>     at ServerResponse.OutgoingMessage._renderHeaders (http.js:733:11)
>     at ServerResponse.writeHead (http.js:1150:20)
>     at ClientRequest.proxyError 
> (/.../node_modules/http-proxy/lib/node-http-proxy/http-proxy.js:213:9)
>     at ClientRequest.g (events.js:180:16)
>     at ClientRequest.EventEmitter.emit (events.js:95:17)
>     at Socket.socketErrorListener (http.js:1547:9)
>     at Socket.EventEmitter.emit (events.js:95:17)
>     at net.js:441:14
>     at process._tickDomainCallback (node.js:459:13)
> ---------------------------------------------------------------
>
> The pertinent code snippet is as follows:
> ---------------------------------------------------------------
>   var proxyDomain = domain.create();
>   proxyDomain.on('error', ...);
>   proxyDomain.on('proxyError', ...);
>
>   spdy.createServer
>   ( 
>     ...
>     proxyDomain.run
>     (
>       function()
>       {
>         var proxy = new httpProxy.HttpProxy({target: {host: ..., port: 
> ...}});
>         ...
>         proxy.proxyRequest(req,res);
>       }
>     );
>   );
> ---------------------------------------------------------------
>
>
> Anything blatantly wrong?  
>
> Thanks for reading.
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to