Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

caw

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caw

Construct HTTP/HTTPS agents for tunneling proxies

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-9.59%
Maintainers
1
Weekly downloads
 
Created

What is caw?

The 'caw' npm package is a utility for handling HTTP/HTTPS proxies in Node.js. It simplifies the process of making HTTP requests through proxies, which can be useful for various purposes such as web scraping, testing, and accessing geo-restricted content.

What are caw's main functionalities?

Proxy HTTP Requests

This feature allows you to make HTTP requests through a proxy. The code sample demonstrates how to use 'caw' with the 'got' library to make a request to an API endpoint through a proxy.

const caw = require('caw');
const got = require('got');

(async () => {
  const proxy = caw();
  const response = await got('https://api.ipify.org?format=json', { agent: { https: proxy } });
  console.log(response.body);
})();

Custom Proxy Configuration

This feature allows you to configure custom proxy settings. The code sample shows how to specify a custom proxy server with 'caw' and use it to make an HTTP request.

const caw = require('caw');
const got = require('got');

(async () => {
  const proxy = caw({ protocol: 'http', hostname: 'proxy.example.com', port: 8080 });
  const response = await got('https://api.ipify.org?format=json', { agent: { https: proxy } });
  console.log(response.body);
})();

Automatic Proxy Detection

This feature allows 'caw' to automatically detect and use the system's proxy settings. The code sample demonstrates how to make an HTTP request using the system's proxy configuration.

const caw = require('caw');
const got = require('got');

(async () => {
  const proxy = caw();
  const response = await got('https://api.ipify.org?format=json', { agent: { https: proxy } });
  console.log(response.body);
})();

Other packages similar to caw

Keywords

FAQs

Package last updated on 20 Jul 2017

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