Skip to content

Wrap isomorphic-fetch to enable a proxy use.

Notifications You must be signed in to change notification settings

tcione/node-fetch-with-proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use isomorphic fetch behind a proxy

A wrapper of isomorphic-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://github.com/matthew-andrews/isomorphic-fetch

Related projects

License

MIT/X11

About

Wrap isomorphic-fetch to enable a proxy use.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%