Closed kilianc closed 8 years ago
PR is welcome.
this is how I fixed it:
app.use(mount('/es', function *(next) {
this.header.host = process.env.ES_HOST
this.header.authorization = 'Basic ' + process.env.ES_AUTH
yield* next
}))
app.use(mount('/es', proxy({
host: process.env.ES_PROTOCOL + process.env.ES_HOST
})))
in my case I am proxying to elasticsearch on bonsai.io
I will try to submit a PR but I can't promise to be able to this week.
This PR, #20, allows you to control the options of the proxied request, including headers.
How do I add an
Authorization
header to the proxied req ?