fetch-with-proxy
Wrap isomorphic fetch to enable proxy use.
Last updated 2 months ago by touv .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fetch-with-proxy 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.1                                ...           latest (2 months ago)

5 Versions

  • 2.0.1                                ...           2 months ago
  • 2.0.0                                ...           2 months ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 1
Dependencies (3)
Dev Dependencies (11)

Copyright 2014 - 2017 © taobao.org |