New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

proxy-to-string

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-to-string

Creating a proxy string from objects.

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Proxy to String

Build Status npm

Creating a proxy string from objects.

npm i proxy-to-string

Examples:

const proxyToString = require('proxy-to-string');
proxyToString({
  protocol: 'https',
  ipAddress: '123.123.2.42',
  port: '8080',
  login: 'superLogin',
  password: 'superPassword'
});

// return this:
// 'https://123.123.2.42:8080@superLogin:superPassword'

If you want the login and password to go at the beginning, just put loginPassFirst: true

const proxyToString = require('proxy-to-string');
proxyToString({
  protocol: 'https',
  ipAddress: '123.123.2.42',
  port: '8080',
  login: 'superLogin',
  password: 'superPassword',
  loginPassFirst: true
});

// return this:
// 'https://superLogin:superPassword@123.123.2.42:8080'

If your login and password looks like this: superLogin:superPassword or/and your ip address: 123.123.2.42: 8080 then use loginPassword and/or ipAddressPort. These options are always in priority.

const proxyToString = require('proxy-to-string');
proxyToString({
  protocol: 'https',
  loginPassword: 'superLogin:superPassword',
  ipAddressPort: '123.123.2.42:8080'
});

// return this:
// 'https://123.123.2.42:8080@superLogin:superPassword'

You can ignore any options, and, say, leave only ipAddress and port

const proxyToString = require('proxy-to-string');
proxyToString({
  ipAddress: '123.123.2.42',
  port: '8080'
});

// return this:
// '123.123.2.42:8080'

Keywords

proxy

FAQs

Package last updated on 16 Feb 2019

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