# undici-noproxy

> no_proxy ProxyAgent for undici

Latest version **1.1.0** (published 2025-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install undici-noproxy
pnpm add undici-noproxy
yarn add undici-noproxy
bun add undici-noproxy
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2025-01-16 |
| First published | 2022-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 20 |
| Dependencies | 2 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | commenthol |
| Maintainers | commenthol |
| Keywords | proxy, no_proxy, no-proxy |

## Links

- npm: https://www.npmjs.com/package/undici-noproxy
- Repository: https://github.com/commenthol/undici-noproxy
- Homepage: https://github.com/commenthol/undici-noproxy#readme
- Issues: https://github.com/commenthol/undici-noproxy/issues
- npm.io page: https://npm.io/package/undici-noproxy

## Dependencies (2)

- [undici](https://npm.io/package/undici.md) ^7.2.2
- [uses-proxy](https://npm.io/package/uses-proxy.md) ^1.1.0

## Recent versions

- 1.1.0 (latest) — 2025-01-16
- 1.0.2 — 2024-07-15
- 1.0.1 — 2022-09-15
- 1.0.0 — 2022-03-26

## README

# undici-noproxy

> no_proxy ProxyAgent for undici

An [undici ProxyAgent](https://undici.nodejs.org/#/docs/api/ProxyAgent) which considers `http(s)_proxy` and `no_proxy` env-vars or settings. 

# usage

```
npm i undici-noproxy
```

## proxy settings in code

```js
import { request } from 'undici'
import { NoProxyAgent } from 'undici-noproxy'

const proxyAgent = new NoProxyAgent({
  uri: 'http://my-http.proxy',
  protocol: 'http',
  noProxy: 'localhost,.my.domain'
})

const res = await request('https://httpbin.org/anything', { dispatcher: proxyAgent })
const json = await res.body.json()
proxyAgent.close()
```

## proxy settings via env vars

```
http_proxy=http://my-http.proxy
no_proxy=localhost,.my.domain
```

`NoProxyAgent` considers the settings from the given env-vars...

```js
import { request } from 'undici'
import { NoProxyAgent } from 'undici-noproxy'

const proxyAgent = new NoProxyAgent()

const res = await request('https://httpbin.org/anything', { dispatcher: proxyAgent })
const json = await res.body.json()
proxyAgent.close()
```

## with global dispatcher

```js
import { fetch, setGlobalDispatcher } from 'undici'
import { NoProxyAgent } from 'undici-noproxy'
const proxyAgent = new NoProxyAgent()

setGlobalDispatcher(proxyAgent)

const res = await fetch(url)
const json = await res.json()
```


# license

MIT licensed

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