-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Vladislav Puzyrev edited this page Mar 6, 2023
·
3 revisions
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.
Using npm:
npm install proxy-string-parser
Using yarn:
yarn add proxy-string-parser
import proxyParser from 'proxy-string-parser'
const proxy = proxyParser('protocol://username:password@host:80')
console.log(proxy)