simple-proxy-agent
1.1.0 • Public • Published simple-proxy-agent
An simple agent for HTTP and HTTPS through HTTP and SOCKS proxies
Table of Contents
Install
npm install simple-proxy-agent
Usage
Proxy Request
const fetch = require('node-fetch');
const ProxyAgent = require('simple-proxy-agent');
fetch('https://example.com', {
agent: new ProxyAgent('http://0.0.0.0:8080', {
tunnel: true,
timeout: 5000,
})
})
.then(res => res.text())
.then(body => console.log(body))
.catch(err => console.error(err))
Basic Authentication
const fetch = require('node-fetch');
const ProxyAgent = require('simple-proxy-agent');
fetch('https://example.com', {
agent: new ProxyAgent('http://user:password@0.0.0.0:8080')
})
.then(res => res.text())
.then(body => console.log(body))
.catch(err => console.error(err))
License
MIT
/simple-proxy-agent/
//
Package Sidebar
Install
Weekly Downloads