Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Can't render headers after they are sent to the client. #443

Open
nfroidure opened this Issue · 4 comments

2 participants

@nfroidure

I've got recurrent errors using http-proxy@0.10.3 with the following message. How to avoid it ?

http.js:687
throw new Error('Can\'t render headers after they are sent to the client.'
^
Error: Can't render headers after they are sent to the client.
at ServerResponse.OutgoingMessage._renderHeaders (http.js:687:11)
at ServerResponse.writeHead (http.js:951:20)
at ClientRequest.proxyError (/home/nodejs/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js:203:9)
at ClientRequest.g (events.js:192:14)
at ClientRequest.EventEmitter.emit (events.js:96:17)
at Socket.socketErrorListener (http.js:1331:9)
at Socket.EventEmitter.emit (events.js:96:17)
at Socket._destroy.self.errorEmitted (net.js:329:14)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

@nfroidure

Here is the code i use:

var http = require('http')
    httpProxy = require('http-proxy');

httpProxy.createServer({
    hostnameOnly: true,
  router: {
    'xxx.com' : '127.0.0.1:8124',
    'xx.com' : '127.0.0.1:8125',
    'x.com': '127.0.0.1:8126'
  }
}).listen(80);
@nfroidure

Seems to be a duplicate of #388

@nfroidure

Maybe usefull:

# node -v
v0.8.16
@inian

I am getting this error when trying to proxy http://www.amazon.de/ website. Can someone reproduce the bug for this website?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.