Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
node-http-proxy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
node-http-proxy
Commits
887c5808
Commit
887c5808
authored
May 25, 2011
by
indexzero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] Manage our own internal list of Agent instances
parent
a1cdf005
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
lib/node-http-proxy.js
lib/node-http-proxy.js
+22
-7
No files found.
lib/node-http-proxy.js
View file @
887c5808
...
@@ -36,6 +36,11 @@ var util = require('util'),
...
@@ -36,6 +36,11 @@ var util = require('util'),
//
//
exports
.
version
=
[
0
,
5
,
7
];
exports
.
version
=
[
0
,
5
,
7
];
//
// Track our own list of agents internal to `node-http-proxy`
//
var
_agents
=
{};
//
//
// ### function _getAgent (host, port, secure)
// ### function _getAgent (host, port, secure)
// #### @host {string} Host of the agent to get
// #### @host {string} Host of the agent to get
...
@@ -45,13 +50,23 @@ exports.version = [0, 5, 7];
...
@@ -45,13 +50,23 @@ exports.version = [0, 5, 7];
// and sets the `maxSockets` property appropriately.
// and sets the `maxSockets` property appropriately.
//
//
function
_getAgent
(
host
,
port
,
secure
)
{
function
_getAgent
(
host
,
port
,
secure
)
{
var
agent
=
!
secure
?
http
.
getAgent
(
host
,
port
)
:
https
.
getAgent
({
var
Agent
,
id
=
[
host
,
port
].
join
(
'
:
'
);
if
(
!
port
)
{
port
=
secure
?
443
:
80
;
}
if
(
!
_agents
[
id
])
{
Agent
=
secure
?
https
.
Agent
:
http
.
Agent
;
_agents
[
id
]
=
new
Agent
({
host
:
host
,
host
:
host
,
port
:
port
port
:
port
,
maxSockets
:
maxSockets
});
});
}
agent
.
maxSockets
=
maxSockets
;
return
_agents
[
id
];
return
agent
;
}
}
//
//
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment