Skip to content

Commit c4d185d

Browse files
committed
prefer target.hostname over target.host
1 parent ed06af9 commit c4d185d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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
// Open new HTTP request to internal resource with will act

0 commit comments

Comments
 (0)