Socket
Book a DemoInstallSign in
Socket

@devhigley/parse-proxy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devhigley/parse-proxy

Node.js proxy string parser

1.0.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

parse-proxy Build Status

Description

parse-proxy is a lightweight Node.js proxy string parsing library

What it does:

  • parses a string of proxies into an array of proxy objects
  • supports multiple delimiters (comma, newline, space)
  • supports proxy authentication
  • supports proxy protocols

Installation

npm install @devhigley/parse-proxy
yarn add @devhigley/parse-proxy

Usage

Basic example delimited by comma and space:

const parseProxy = require("@devhigley/parse-proxy");

parseProxy(`1.1.1.1:80, 2.2.2.2:80, 3.3.3.3:80`);

Result:

[
  { host: '1.1.1.1', port: 80, protocol: 'http' },
  { host: '2.2.2.2', port: 80, protocol: 'http' },
  { host: '3.3.3.3', port: 80, protocol: 'http' }
]

Example with protocol and authentication, delimited by new line:

const parseProxy = require("@devhigley/parse-proxy");

parseProxy(`https://user:pass@104.236.55.48:8080
            https://user:pass@213.105.29.14:3128`);

Result:

[
  {
    host: '104.236.55.48',
    port: 8080,
    protocol: 'https',
    auth: { username: 'user', password: 'pass' }
  },
  {
    host: '213.105.29.14',
    port: 3128,
    protocol: 'https',
    auth: { username: 'user', password: 'pass' }
  }
]

Keywords

parse

FAQs

Package last updated on 06 Feb 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.