Skip to content

Commit f28c62c

Browse files
committed
Merge pull request #235 from Filirom1/patch-1
prefer `target.hostname` over `target.host`
2 parents 0273958 + c4d185d commit f28c62c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: lib/node-http-proxy/http-proxy.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,13 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
209209
//
210210
// Setup outgoing proxy with relevant properties.
211211
//
212-
outgoing.host = this.target.host;
213-
outgoing.port = this.target.port;
214-
outgoing.agent = this.target.agent;
215-
outgoing.method = req.method;
216-
outgoing.path = req.url;
217-
outgoing.headers = req.headers;
212+
outgoing.host = this.target.host;
213+
outgoing.hostname = this.target.hostname;
214+
outgoing.port = this.target.port;
215+
outgoing.agent = this.target.agent;
216+
outgoing.method = req.method;
217+
outgoing.path = req.url;
218+
outgoing.headers = req.headers;
218219

219220
//
220221
// If the changeOrigin option is specified, change the

0 commit comments

Comments
 (0)