curlconverter / curlconverter

Transpile curl commands into Python, JavaScript and 27 other languages
https://curlconverter.com
MIT License
7.17k stars 867 forks source link

add support for --proxy #629

Open ralyodio opened 3 months ago

ralyodio commented 3 months ago

in node.js you can do it with this:

import { HttpProxyAgent } from 'http-proxy-agent';
import fetch from 'node-fetch';

const proxyUrl = env.PROXY_URL;
const proxyAgent = new HttpProxyAgent(proxyUrl);

...
options.agent = proxyAgent;
await fetch(url, options);