Socket
Socket
Sign inDemoInstall

fetch-with-proxy

Package Overview
Dependencies
11
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fetch-with-proxy

Wrap node-fetch to enable proxy use.


Version published
Weekly downloads
4.6K
decreased by-20.85%
Maintainers
1
Install size
258 kB
Created
Weekly downloads
 

Readme

Source

Use fetch behind a proxy

A wrapper of fetch that can be use behind a proxy.

It detect standard environment variables (HTTP_PROXY, https_proxy, etc.) to choose and use the proxy.

Unlike many similar packages, this one does not use tunnel in HTTP, like request, like browsers.

Example


import fetch from 'fetch-with-proxy';

const url = 'https://nodejs.org/';
fetch(url)
      .then((response) => response.text());
      .then(console.log)
      .catch(console.error)


Installation

With npm:

$ npm install fetch-with-proxy

Tests

Use mocha to run the tests.

$ mocha test

Environment variables

  • HTTP_PROXY
  • http_proxy
  • HTTPS_PROXY
  • https_proxy
  • ALL_PROXY
  • NO_PROXY

API Documentation

see https://www.npmjs.com/package/node-fetch

License

MIT/X11

Keywords

FAQs

Last updated on 21 Dec 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc