JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q68405F
  • License MIT

Parsing proxy string

Package Exports

  • proxy-string-parser
  • proxy-string-parser/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (proxy-string-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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
}

Install

npm install proxy-string-parser

Usage

import proxyParser from 'proxy-string-parser'

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

API

Table of contents

Interfaces

Functions

Functions

default

default(proxy): Proxy

Parameters

Name Type
proxy string

Returns

Proxy

Defined in

proxyParser.ts:3

Interface: Proxy

Table of contents

Properties

Properties

auth

Optional auth: Object

Type declaration

Name Type
password string
username string

Defined in

types/Proxy.ts:4


host

host: string

Defined in

types/Proxy.ts:2


port

port: number

Defined in

types/Proxy.ts:3


protocol

Optional protocol: string

Defined in

types/Proxy.ts:8