Skip to content
Vladislav Puzyrev edited this page Mar 6, 2023 · 3 revisions

proxy-string-parser

Parsing strings of the following formats:

protocol://username:password@host:port
protocol://host:port
username:password@host:port
host:port

To the Proxy object:

interface Proxy {
  host: string
  port: number
  auth?: {
    username: string
    password: string
  }
  protocol?: string
}

TypeDoc documentation is available on wiki.

Install

Using npm:

npm install proxy-string-parser

Using yarn:

yarn add proxy-string-parser

Usage

import proxyParser from 'proxy-string-parser'

const proxy = proxyParser('protocol://username:password@host:80')
console.log(proxy)

proxy-string-parser

Clone this wiki locally