Skip to content

Commit

Permalink
Added proxy support
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Jan 27, 2012
1 parent d25d3b7 commit d4894c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ npm test
Here is a list of [Contributors](http://github.com/pksunkara/npm-police/contributors)

### TODO
- Proxy support
- Option to isolate dependency checking and suggestions
- Support multiple npm registries (custom)
- Display progress bar instead of listing the dependencies (use charm)
Expand Down
18 changes: 12 additions & 6 deletions lib/police/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ github.token = function (auth) {
}),
headers: {
"Content-type": "application/json"
}
},
proxy: process.env.https_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==201) {
Expand Down Expand Up @@ -244,7 +245,8 @@ github.v2 = function (uri, callback) {
url: github.options.v2.url + uri,
headers: {
"Authorization": "token " + police.config.token(police)
}
},
proxy: process.env.http_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
Expand All @@ -265,7 +267,8 @@ github.get = function (uri, callback) {
url: github.options.url + uri,
headers: {
"Authorization": "token " + police.config.token(police)
}
},
proxy: process.env.https_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
Expand All @@ -289,7 +292,8 @@ github.post = function (uri, content, callback) {
headers: {
"Content-type": "application/json",
"Authorization": "token " + police.config.token(police)
}
},
proxy: process.env.https_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
Expand All @@ -313,7 +317,8 @@ github.put = function (uri, content, callback) {
headers: {
"Content-type": "application/json",
"Authorization": "token " + police.config.token(police)
}
},
proxy: process.env.https_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
Expand All @@ -337,7 +342,8 @@ github.del = function (uri, content, callback) {
headers: {
"Content-type": "application/json",
"Authorization": "token " + police.config.token(police)
}
},
proxy: process.env.https_proxy
}, function (err, res, body) {
if (err) police.exit(err);
if (res.statusCode==404) {
Expand Down

0 comments on commit d4894c8

Please sign in to comment.