Socket
Socket
Sign inDemoInstall

simple-proxy-agent

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-proxy-agent

An simple agent for HTTP and HTTPS through HTTP and SOCKS proxies


Version published
Weekly downloads
1.4K
decreased by-11.45%
Maintainers
1
Install size
341 kB
Created
Weekly downloads
 

Readme

Source

simple-proxy-agent

Build status Package version NPM downloads Make a pull request License: MIT

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', {
    // Options, with all defaults
    tunnel: true, // If true, will tunnel all HTTPS using CONNECT method
    timeout: 5000, // Time in milli-seconds, to maximum wait for proxy connection to establish
  })
})
.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

Keywords

FAQs

Last updated on 03 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc