yakbak
yakbak copied to clipboard
Odd behaviour when connecting to an https backend
I'm attempting to create a proxy to an https API that sits behind Cloudflare:
http.createServer(yakbak('https://--domain--', { dirname: __dirname + '/tapes' })).listen(3000);
When I do this, and curl the proxy:
curl -i localhost:3000/status
I get an error from cloudflare "The request's Host header does not match the request's TLS SNI Host header."
I've got a code change for the proxy to fix this; updating the headers collection prior to mod.request rather than using preq.setHeader('Host', uri.host), and this fixes it, but wasn't able to reproduce it with a test.