Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/commenthol/got-proxy

proxy agent for got
https://github.com/commenthol/got-proxy

got http-proxy https-proxy no-proxy

Last synced: 4 days ago
JSON representation

proxy agent for got

Awesome Lists containing this project

README

        

# got-proxy

> proxy agent for got

A proxy agent for [got](https://github.com/sindresorhus/got) which considers
`http(s)_proxy` and `no_proxy` env-vars or settings.

# usage

```
npm i got-proxy
```

## proxy settings in code

```js
import { gotProxy } from 'got-proxy'

const got = gotProxy({
proxy: 'http://my-http.proxy',
noProxy: 'localhost,.my.domain'
})

const res = await got('https://httpbin.org/anything')
```

## proxy settings via env vars

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

```js
import { gotProxy } from 'got-proxy'
const got = gotProxy()

const res = await got('https://httpbin.org/anything')
```

# license

MIT licensed