Home
last modified time | relevance | path

Searched refs:agent (Results 1 - 25 of 84) sorted by relevance

1234

/third_party/node/test/parallel/
H A Dtest-http-agent-scheduling.js14 function makeRequest(url, agent, callback) {
16 .request(url, { agent }, (res) => {
29 function bulkRequest(url, agent, done) {
31 let count = agent.maxSockets;
33 for (let i = 0; i < agent.maxSockets; i++) {
34 makeRequest(url, agent, callback);
52 const agent = new http.Agent({
57 bulkRequest(url, agent, (ports) => {
58 makeRequest(url, agent, (port) => {
60 makeRequest(url, agent, (por
[all...]
H A Dtest-http-agent-keepalive.js30 const agent = new Agent({
53 agent: agent,
60 assert.strictEqual(agent.sockets[name].length, 1);
61 assert.strictEqual(agent.freeSockets[name], undefined);
62 assert.strictEqual(agent.totalSocketCount, 1);
72 assert.strictEqual(agent.sockets[name].length, 1);
73 assert.strictEqual(agent.freeSockets[name], undefined);
75 assert.strictEqual(agent.sockets[name], undefined);
76 assert.strictEqual(agent
[all...]
H A Dtest-http-keep-alive.js35 const agent = new http.Agent({ maxSockets: 1 });
40 name = agent.getName({ port: this.address().port });
42 path: '/', headers: headers, port: this.address().port, agent: agent
44 assert.strictEqual(agent.sockets[name].length, 1);
45 assert.strictEqual(agent.requests[name].length, 2);
50 path: '/', headers: headers, port: this.address().port, agent: agent
52 assert.strictEqual(agent.sockets[name].length, 1);
53 assert.strictEqual(agent
[all...]
H A Dtest-http-keep-alive-close-on-header.js40 const agent = new http.Agent({ maxSockets: 1 });
41 const name = agent.getName({ port: this.address().port });
47 agent: agent
49 assert.strictEqual(agent.sockets[name].length, 1);
64 agent: agent
66 assert.strictEqual(agent.sockets[name].length, 1);
80 agent: agent
[all...]
H A Dtest-http-addrequest-localaddress.js9 const agent = require('http').globalAgent;
16 agent.maxSockets = 0;
20 agent.addRequest(req, 'localhost', 8080, '127.0.0.1');
21 assert.strictEqual(Object.keys(agent.requests).length, 1);
23 Object.keys(agent.requests)[0],
28 agent.addRequest(req, {
34 assert.strictEqual(Object.keys(agent.requests).length, 1);
36 Object.keys(agent.requests)[0],
H A Dtest-https-agent-create-connection.js11 const agent = new https.Agent();
54 _agentKey: agent.getName({ port, host })
57 const socket = agent.createConnection(options);
70 _agentKey: agent.getName({ port, host })
72 const socket = agent.createConnection(port, options);
85 _agentKey: agent.getName({ port, host })
87 const socket = agent.createConnection(port, host, options);
101 const socket = agent.createConnection(port, host, options);
113 const socket = agent.createConnection(port, host, options);
128 const socket = agent
[all...]
H A Dtest-http-client-reject-unexpected-agent.js14 'agent',
34 function createRequest(agent) {
35 const options = Object.assign(baseOptions, { agent });
49 failingAgentOptions.forEach((agent) => {
51 () => createRequest(agent),
55 message: 'The "options.agent" property must be one of Agent-like ' +
57 common.invalidArgTypeHelper(agent)
62 acceptableAgentOptions.forEach((agent) => {
63 createRequest(agent);
H A Dtest-http-agent-maxtotalsockets.js33 const agent = new http.Agent({
53 agent.destroy();
63 agent,
69 for (const key of Object.keys(agent.sockets)) {
70 assert(agent.sockets[key].length <= maxSockets);
81 for (const key of Object.keys(agent.sockets)) {
82 num += agent.sockets[key].length;
89 for (const key of Object.keys(agent.requests)) {
90 num += agent.requests[key].length;
H A Dtest-https-agent-abort-controller.js13 const agent = new Agent();
29 _agentKey: agent.getName({ port, host })
35 const connection = agent.createConnection({ ...options, signal });
46 const connection = agent.createConnection({ ...options, signal });
58 agent: agent,
74 agent: agent,
H A Dtest-http-agent-maxsockets.js7 const agent = new http.Agent({
24 agent: agent,
30 const freepool = agent.freeSockets[Object.keys(agent.freeSockets)[0]];
33 agent.destroy();
H A Dtest-http-agent-maxsockets-respected.js13 const agent = new http.Agent({
33 agent: agent,
49 const sockets = agent.sockets[Object.keys(agent.sockets)[0]];
H A Dtest-https-agent-sockets-leak.js22 const agent = new https.Agent({
33 agent: agent
38 // Only one entry should exist in agent.sockets pool
39 // If there are more entries in agent.sockets,
41 assert.strictEqual(Object.keys(agent.sockets).length, 1);
45 // exist in agent.sockets pool after both request and socket
47 assert.strictEqual(Object.keys(agent.sockets).length, 0);
H A Dtest-https-agent-sni.js39 const agent = new https.Agent({
44 agent: agent,
54 agent: agent,
H A Dtest-http-client-override-global-agent.js12 const agent = new http.Agent();
13 const name = agent.getName({ port: server.address().port });
14 http.globalAgent = agent;
17 assert(name in agent.sockets); // Agent has indeed been used
H A Dtest-https-agent-getname.js10 const agent = new https.Agent();
14 agent.getName(),
20 agent.getName({}),
50 agent.getName(options),
H A Dtest-http-client-timeout-connect-listener.js19 const agent = new http.Agent({ keepAlive: true, maxSockets: 1 });
20 const options = { port: server.address().port, agent: agent };
24 agent.destroy();
H A Dtest-https-client-override-global-agent.js23 const agent = new https.Agent();
24 const name = agent.getName({ port: server.address().port });
25 https.globalAgent = agent;
28 assert(name in agent.sockets); // Agent has indeed been used
H A Dtest-http-client-timeout-option-listeners.js6 const agent = new http.Agent({ keepAlive: true });
16 agent,
31 agent.destroy();
38 const sockets = agent.sockets[`${options.host}:${options.port}:`];
H A Dtest-http-keepalive-request.js44 const agent = http.Agent({ keepAlive: true });
55 agent.destroy();
62 agent: agent
/third_party/python/Lib/test/
H A Dtest_robotparser.py14 agent = 'test_robotparser' variable in BaseRobotTest
26 agent, url = url
27 return agent, url
28 return self.agent, url
32 agent, url = self.get_agent_and_url(url)
33 with self.subTest(url=url, agent=agent):
34 self.assertTrue(self.parser.can_fetch(agent, url))
38 agent, url = self.get_agent_and_url(url)
39 with self.subTest(url=url, agent
144 agent = 'figtree' global() variable in CrawlDelayAndRequestRateTest
153 agent = 'FigTree Robot libwww-perl/5.04' global() variable in DifferentAgentTest
192 agent = 'Googlebot' global() variable in AnotherInvalidRequestRateTest
208 agent = 'Googlebot' global() variable in UserAgentOrderingTest
213 agent = 'Googlebot-Mobile' global() variable in UserAgentGoogleMobileTest
224 agent = 'googlebot' global() variable in GoogleURLOrderingTest
[all...]
/third_party/node/lib/
H A D_http_client.js157 let agent = options.agent;
159 if (agent === false) {
160 agent = new defaultAgent.constructor();
161 } else if (agent === null || agent === undefined) {
163 agent = defaultAgent;
165 // Explicitly pass through this statement as agent will not be used
167 } else if (typeof agent.addRequest !== 'function') {
168 throw new ERR_INVALID_ARG_TYPE('options.agent',
[all...]
H A D_http_agent.js127 debug('agent.on(free)', name);
200 const agent = this;
202 agent.emit('keylog', keylog, this);
228 // Pacify parallel/test-http-agent-getname by only appending
374 function installListeners(agent, s, options) {
377 agent.emit('free', s, options);
386 agent.totalSocketCount--;
387 agent.removeSocket(s, options);
396 const sockets = agent.freeSockets;
410 agent
[all...]
/third_party/node/deps/undici/src/lib/
H A Dglobal.js7 const Agent = require('./agent')
13 function setGlobalDispatcher (agent) {
14 if (!agent || typeof agent.dispatch !== 'function') {
15 throw new InvalidArgumentError('Argument agent must implement Agent')
18 value: agent,
/third_party/node/src/tracing/
H A Dtrace_event.cc10 void TraceEventHelper::SetAgent(Agent* agent) { in SetAgent() argument
11 if (agent) { in SetAgent()
12 g_agent = agent; in SetAgent()
13 g_controller = agent->GetTracingController(); in SetAgent()
/third_party/node/deps/npm/node_modules/@npmcli/agent/lib/
H A Dindex.js11 const getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => {
13 if (agent != null) {
14 return agent
48 agent: agentCache,

Completed in 5 milliseconds

1234