@totallynodavid/proxy-wrapper
v1.0.1
Published
A fast proxy wrapper for fetch requests
Downloads
1
Readme
proxy-wrapper
A lightweight proxy wrapper for fetch requests.
Installation
npm i @totallynodavid/proxy-wrapper
Setup
- Create an
.env
file in your project root:
PROXY_HOST=your_proxy_host
PROXY_PORT=your_proxy_port
PROXY_USERNAME=your_proxy_username
PROXY_PASSWORD=your_proxy_password
Usage
import {withProxy} from 'fast-proxy-wrapper';
const originalFunction = async () => {
const response = await fetch('https://api.example.com/data');
return response.json();
};
const proxiedFunction = withProxy(originalFunction);