mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Use changeOrigin for proxyRequest.
This commit is contained in:
parent
04ce49c5b2
commit
0273958b0a
@ -216,6 +216,14 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
|
|||||||
outgoing.path = req.url;
|
outgoing.path = req.url;
|
||||||
outgoing.headers = req.headers;
|
outgoing.headers = req.headers;
|
||||||
|
|
||||||
|
//
|
||||||
|
// If the changeOrigin option is specified, change the
|
||||||
|
// origin of the host header to the target URL! Please
|
||||||
|
// don't revert this without documenting it!
|
||||||
|
//
|
||||||
|
if(this.changeOrigin)
|
||||||
|
outgoing.headers.host = this.target.host + ':' + this.target.port;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open new HTTP request to internal resource with will act
|
// Open new HTTP request to internal resource with will act
|
||||||
// as a reverse proxy pass
|
// as a reverse proxy pass
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user