Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing proxy fields #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added missing proxy fields
When using http.get() to request a file through a proxy, the following
were missing from the previous implementation:

* The `http://` protocol
* The `headers` object indicating the target `Host`

These additions are based on http://stackoverflow.com/a/6781592/1228454
and work for our company proxy (MS NTLM Proxy).
nwinkler committed Nov 12, 2015
commit 8bb7607d9c806040ebd0ed914b9d64403e2f1f09
9 changes: 6 additions & 3 deletions install.js
Original file line number Diff line number Diff line change
@@ -131,10 +131,14 @@ function download_file(callback) {

console.log('Proxy server detected, using proxy settings to download (%s)', proxyServer);

unicodedatafile.path = unicodedatafile.host
+ ":"
unicodedatafile.path = 'http://'
+ unicodedatafile.host
+ ':'
+ unicodedatafile.port
+ unicodedatafile.path;
unicodedatafile.headers = {
Host: unicodedatafile.host
};
unicodedatafile.host = proxyVars[2];
unicodedatafile.port = proxyVars[4];
}
@@ -179,4 +183,3 @@ if (!module.parent) { // not required
download_file:download_file,
};
}