Skip to content

Commit

Permalink
+ proxyAuth to pass proxy authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Tamse committed Aug 23, 2016
1 parent 85e257b commit 416338e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var globalTunnel = require('global-tunnel');
globalTunnel.initialize({
host: '10.0.0.10',
port: 8080,
proxyAuth: 'userId:password', // optional authentication
sockets: 50 // optional pool size for each http and https
});
```
Expand Down Expand Up @@ -58,6 +59,7 @@ The complete list of options to `globalTunnel.initialize`:
- **https** - _(the default)_ only use `CONNECT` for HTTPS requests
- **both** - use `CONNECT` for both HTTP and HTTPS requests
- **protocol** - the protocol that the proxy speaks, either `http:` or `https:`.
- **proxyAuth** - _(optional)_ to authenticate `userId:password`
- **sockets** - _(optional)_ maximum number of TCP sockets to use in each pool.
There are two pools: one for HTTP and one for HTTPS. Uses node's default (5)
if falsy.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ globalTunnel._makeAgent = function(conf, innerProtocol, useCONNECT) {
innerProtocol = innerProtocol + ':';

var opts = {
proxy: _.pick(conf, 'host','port','protocol','localAddress'),
proxy: _.pick(conf, 'host','port','protocol','localAddress','proxyAuth'),
maxSockets: conf.sockets
};
opts.proxy.innerProtocol = innerProtocol;
Expand Down

0 comments on commit 416338e

Please sign in to comment.