Socket
Socket
Sign inDemoInstall

node-cookie-proxy-agent

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-cookie-proxy-agent

HTTP & HTTPS agents with cookie and proxy support


Version published
Weekly downloads
159
decreased by-29.33%
Maintainers
1
Weekly downloads
 
Created
Source

Install

npm install node-cookie-proxy-agent http-proxy-agent https-proxy-agent tough-cookie

Usage

Pass node-cookie-proxy-agent to HTTP clients instead of http(s).Agent.

For exemple with axios:

import axios from 'axios';
import { HttpCookieProxyAgent, HttpsCookieProxyAgent } from 'node-cookie-proxy-agent';
import { CookieJar } from 'tough-cookie';

(async () => {
	// initialise this first
	const jar = new CookieJar();
	const httpAgent = new HttpCookieProxyAgent(jar, 'http://127.0.0.1:8888'); // or http://id:password@127.0.0.1:8888 to use with authentication
	const httpsAgent = new HttpsCookieProxyAgent(jar, 'http://127.0.0.1:8888');

	// add your agents to your http client
	const axiosClient = axios.create({ httpAgent, httpsAgent });
	console.log('result: ', (await axiosClient.get('https://api.ipify.org?format=json')).data);
})().catch(err => console.error(err));

Keywords

FAQs

Package last updated on 06 May 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc