InstantWebP2P/httpp-proxy

http 1.1 host header is not set

Closed this issue · 0 comments

sample code

var http = require('http');
var httpProxy = require('http-proxy');
httpProxy.createProxyServer({target:'http://damhoret-website-cloudfront.s3-website-ap-southeast-2.amazonaws.com/'}).listen(9000);

when i issue a get request

$ curl http://localhost:9000/
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<h1>301 Moved Permanently</h1>
<ul>
<li>Code: WebsiteRedirect</li>
<li>Message: Request does not contain a bucket name.</li>
<li>RequestId: E601CD413614A599</li>
<li>HostId: +uP9dkvbG+AQFg3CsZ6O2LBPHr/nVUsRGM9cqFS49VgG0x8VibHP44mZcjA9iF6FpbLN1M6U+Uw=</li>
</ul>
<hr/>
</body>
</html>

but when I access it without proxy:

$ curl http://damhoret-website-cloudfront.s3-website-ap-southeast-2.amazonaws.com
hi

root cause is that 'Host' header is not sent.