
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
@gradientedge/axios-client
Advanced tools
Factory for creating an axios client object with built-in default keep-alive/retry mechanism
@gradientedge/axios-client
A simple factory function for creating an axios client for use in a nodejs environment. No
options are required when calling the getAxiosClient
function. In this case, default values
will be used for the retry and HttpsAgent config.
Note that no HttpAgent
config is provided. We expect all requests to be made via SSL and
therefore the only agent we care about is HttpsAgent
.
Minimal example:
import { getAxiosClient } from '@gradientedge/axios-client'
/**
* No options provided, so this will use the default retry and HttpsAgent configuration.
*/
const client = getAxiosClient()
Full config override example:
import { getAxiosClient } from '@gradientedge/axios-client'
const client = getAxiosClient({
httpsAgent: {
keepAlive: false,
timeout: 10000,
maxSockets: 40,
scheduling: 'lifo',
},
retry: {
delayMs: 100,
maxRetries: 5,
}
})
The client
variable above is an AxiosInstance
which gives you access to all the standard axios methods and functionality.
The following describes below the environment variables which are read in, and which configuration options they apply to if supplied.
REQUEST_TIMEOUT_MS
=> RequestConfig.httpsAgent.timeout
REQUEST_MAX_SOCKETS
=> RequestConfig.httpsAgent.maxSockets
REQUEST_RETRY_MAX_RETRIES
=> RequestConfig.retry.maxRetries
REQUEST_RETRY_DELAY_MS
=> RequestConfig.retry.delayMs
If no values are specified for the config properties above, then the following fallback default values are used:
RequestConfig.httpsAgent.timeout
=> 5000RequestConfig.httpsAgent.maxSockets
=> 20RequestConfig.retry.maxRetries
=> 5RequestConfig.retry.delayMs
=> 50FAQs
Factory for creating an axios client object with built-in default keep-alive/retry mechanism
The npm package @gradientedge/axios-client receives a total of 183 weekly downloads. As such, @gradientedge/axios-client popularity was classified as not popular.
We found that @gradientedge/axios-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).