rittenhop-dev/versions/5.94.2/node_modules/hpagent/test/index.test-d.ts
2024-09-23 19:40:12 -04:00

46 lines
817 B
TypeScript

import * as http from 'http'
import * as https from 'https'
import { expectType } from 'tsd'
import {
HttpProxyAgent,
HttpProxyAgentOptions,
HttpsProxyAgent,
HttpsProxyAgentOptions
} from '../'
{
const agent = new HttpProxyAgent({
keepAlive: true,
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
proxy: 'http://localhost:8080'
})
expectType<HttpProxyAgent>(agent)
http.request({
method: 'GET',
hostname: 'localhost',
port: 9200,
agent
})
}
{
const agent = new HttpsProxyAgent({
keepAlive: true,
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
proxy: 'http://localhost:8080'
})
expectType<HttpsProxyAgent>(agent)
https.request({
method: 'GET',
hostname: 'localhost',
port: 9200,
agent
})
}