New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

praxios

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

praxios

wrapper to support corporate proxies in axios

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

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

praxios

npm GitHub Workflow Status

A wrapper over the axios library to support corporate proxies well

Table of Contents

Installation

npm:

npm install praxios

yarn:

yarn add praxios

Usage

Proxy without authentication

//proxy.js
import praxios from "praxios";

proxios
 .get("/dummy")
 .then(response => {
  console.log(response.data);
 })
 .catch(error => {
  console.log(error);
 });
export PROXY_HOST="my-corporate-proxy.local"
export PROXY_PORT="3128"
node proxy.js
Proxy with authentication
export PROXY_HOST="my-corporate-proxy.local"
export PROXY_PORT="3128"
export PROXY_USERNAME="foo"
export PROXY_PASSWORD="bar"
node proxy.js

Bypass proxy for hosts

export PROXY_HOST="my-corporate-proxy.local"
export PROXY_PORT="3128"
export NO_PROXY="host1.domain,host2.domain,1.2.3.4"
node proxy.js

Customizing the axios settings or using without proxy

The library also exposes the built-in axios library for any advanced configuration or customization

//custom.js
import { baseAxios } from "praxios";

const axios = baseAxios.create({
 httpsAgent: {},
 baseUrl: "",
});

axios
 .get("/dummy")
 .then(response => {
  console.log(response.data);
 })
 .catch(error => {
  console.log(error);
 });

Resources

Credits

praxios was mostly inspired out of the great work and research done by Jan Molak documented very well on this blog post: Node.js Axios behind corporate proxies

License

MIT

FAQs

Package last updated on 04 Dec 2021

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