Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/henry781/proxy-from-uri
This is a simple library without any dependency to get the proxy for an uri using HTTP_PROXY environment variables
https://github.com/henry781/proxy-from-uri
node npm proxy
Last synced: 25 days ago
JSON representation
This is a simple library without any dependency to get the proxy for an uri using HTTP_PROXY environment variables
- Host: GitHub
- URL: https://github.com/henry781/proxy-from-uri
- Owner: henry781
- Created: 2021-06-03T07:13:02.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T11:17:22.000Z (over 3 years ago)
- Last Synced: 2024-10-04T08:34:05.735Z (about 1 month ago)
- Topics: node, npm, proxy
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxy from uri
**From: https://github.com/request/request/blob/master/lib/getProxyFromURI.js**
This is a simple library without any dependency to get the proxy for an uri using HTTP_PROXY environment variables.
This supports NO_PROXY, no_proxy, HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy environment variables.
## Usage
### Install
```
npm install --save @henry781/proxy-from-uri
``````ts
import getProxyFromURI from '@henry781/proxy-from-uri';
// env vars
// http_proxy=http://myproxy.local:3128
// https_proxy=http://myproxy.local:3128
// no_proxy=
const uri = new URL('http://uri.local/api');const result = getProxyFromURI(uri);
// http://myproxy.local:3128
```