# ssrf-agent

> prevent SSRF in http(s) request

Latest version **1.0.5** (published 2021-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install ssrf-agent
pnpm add ssrf-agent
yarn add ssrf-agent
bun add ssrf-agent
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-11-18 |
| First published | 2018-08-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 19 |
| Author | welefen |
| Maintainers | welefen |

## Links

- npm: https://www.npmjs.com/package/ssrf-agent
- Repository: https://github.com/welefen/ssrf-agent
- Homepage: https://github.com/welefen/ssrf-agent#readme
- Issues: https://github.com/welefen/ssrf-agent/issues
- npm.io page: https://npm.io/package/ssrf-agent

## Dependencies (1)

- [ip](https://npm.io/package/ip.md) ^1.1.5

## Recent versions

- 1.0.5 (latest) — 2021-11-18
- 1.0.3 — 2019-10-31
- 1.0.2 — 2018-09-09
- 1.0.1 — 2018-09-07
- 1.0.0 — 2018-08-31

## README

# ssrf-agent

prevent SSRF in http(s) request

## Install

```
npm install ssrf-agent --save
```

## Usage

```js
const ssrfAgent = require('ssrf-agent');
const request = require('request');
// with request module
const url = 'http://www.welefen.com'
request(url, {
  agent: ssrfAgent(url)
}, (err, response, body) => {
  
})
```

```js
const ssrfAgent = require('ssrf-agent');
const fetch = require('node-fetch');
// with node-fetch module
const url = 'http://www.welefen.com'
fetch(url, {
  agent: ssrfAgent(url)
}).then(res => res.text).then(data => {

}).catch(err => {

})
```

## Options

```js
const getAgent = require('ssrf-agent');
const agent = getAgent(ipChecker, agent);
```
* `ipChecker(ip)` {Function} check ip is allowed, default is `require('ip').isPrivate`
* `agent`  {String | Object} default is `http`, support `http` `https` or `agent instance`

---
_Source: https://npm.io/package/ssrf-agent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
