Open steeply opened 6 years ago
I think you can't use proxy with client implementation. But for server version:
import fetch from 'isomorphic-fetch';
import proxyAgent from 'http-proxy-agent';
//import proxyAgent from 'https-proxy-agent'; // HTTPS
const options = {
method: 'GET',
agent: new proxyAgent('http://proxy:8080'),
body: JSON.stringify(data)
};
fetch(url, options)
did agent and http-proxy-agent solve it? can this be closed now?
It did solve for me.
import fetch from 'isomorphic-unfetch';
import HttpsProxyAgent from 'https-proxy-agent';
const res = await fetch('http://api.tvmaze.com/search/shows?q=batman', {agent: new HttpsProxyAgent('<myproxy>')});
Prompt how to use isomorphic-fetch together with a proxy?