Gathering detailed insights and metrics for hpagent-custom-headers
Gathering detailed insights and metrics for hpagent-custom-headers
npm install hpagent-custom-headers
Typescript
Module System
Node Version
NPM Version
JavaScript (97.87%)
TypeScript (2.13%)
Total Downloads
1,051
Last Day
3
Last Week
4
Last Month
12
Last Year
134
20 Commits
2 Branches
1 Contributors
Latest Version
0.1.2
Package Id
hpagent-custom-headers@0.1.2
Unpacked Size
46.21 kB
Size
7.63 kB
File Count
19
NPM Version
6.14.4
Node Version
14.0.0
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
300%
4
Compared to previous week
Last month
200%
12
Compared to previous month
Last year
-32.3%
134
Compared to previous year
A ready to use http and https agent for working with proxies that keeps connections alive!
npm install hpagent
Based on your infrastructure, you should use the http agent or the https agent. The following table will help you picking the right one.
Type | Proxy | Server |
---|---|---|
HttpProxyAgent | HTTP | HTTP |
HttpProxyAgent | HTTPS | HTTP |
HttpsProxyAgent | HTTP | HTTPS |
HttpsProxyAgent | HTTPS | HTTPS |
1const { HttpProxyAgent, HttpsProxyAgent } = require('hpagent')
Once you have understood the right agent for your use case, you can instance it. It takes the same parameter of the Node.js core's http(s) agent and an additional proxy
option, which is the url of your proxy.
1const http = require('http') 2const { HttpProxyAgent } = require('hpagent') 3 4const agent = new HttpProxyAgent({ 5 keepAlive: true, 6 keepAliveMsecs: 1000, 7 maxSockets: 256, 8 maxFreeSockets: 256, 9 proxy: 'http://localhost:8080' 10}) 11 12http.get('http://localhost:9200', { agent }) 13 .on('response', console.log) 14 .end()
If your proxy requires basic authentication, you can configure it in the proxy url:
1const http = require('http') 2const { HttpProxyAgent } = require('hpagent') 3 4const agent = new HttpProxyAgent({ 5 keepAlive: true, 6 keepAliveMsecs: 1000, 7 maxSockets: 256, 8 maxFreeSockets: 256, 9 proxy: 'http://user:pwd@localhost:8080' 10}) 11 12http.get('http://localhost:9200', { agent }) 13 .on('response', console.log) 14 .end()
Following you can find the list of userland http libraries that are tested with this agent.
1got('http://localhost:9200', {
2 agent: {
3 http: new HttpProxyAgent({
4 keepAlive: true,
5 keepAliveMsecs: 1000,
6 maxSockets: 256,
7 maxFreeSockets: 256,
8 scheduling: 'lifo',
9 proxy: 'http://localhost:8080'
10 })
11 }
12})
1needle('get', 'http://localhost:9200', {
2 agent: new HttpProxyAgent({
3 keepAlive: true,
4 keepAliveMsecs: 1000,
5 maxSockets: 256,
6 maxFreeSockets: 256,
7 scheduling: 'lifo',
8 proxy: 'http://localhost:8080'
9 })
10})
1fetch('http://localhost:9200', {
2 agent: new HttpProxyAgent({
3 keepAlive: true,
4 keepAliveMsecs: 1000,
5 maxSockets: 256,
6 maxFreeSockets: 256,
7 scheduling: 'lifo',
8 proxy: 'http://localhost:8080'
9 })
10})
This software is licensed under the MIT.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More