MCPcopy Index your code
hub / github.com/iptv-org/iptv / parse

Method parse

scripts/core/proxyParser.ts:14–30  ·  view source on GitHub ↗
(_url: string)

Source from the content-addressed store, hash-verified

12
13export class ProxyParser {
14 parse(_url: string): ProxyParserResult {
15 const parsed = new URL(_url)
16
17 const result: ProxyParserResult = {
18 protocol: parsed.protocol.replace(':', '') || null,
19 host: parsed.hostname,
20 port: parsed.port ? parseInt(parsed.port) : null
21 }
22
23 if (parsed.username || parsed.password) {
24 result.auth = {}
25 if (parsed.username) result.auth.username = parsed.username
26 if (parsed.password) result.auth.password = parsed.password
27 }
28
29 return result
30 }
31}

Callers 2

getStreamInfoFunction · 0.95
constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected