🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

fetch-with-proxy

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-with-proxy

Wrap node-fetch to enable proxy use.

3.0.1
latest
Source
npm
Version published
Weekly downloads
6.7K
-2.47%
Maintainers
1
Weekly downloads
 
Created
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

http

FAQs

Package last updated on 21 Dec 2020

Did you know?

Socket

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