parse

fun parse(text: String): Proxy

Parse a proxy string into a Proxy object.

Detects the proxy type based on the prefix of the string.

  • http:// for HTTP proxy

  • socks5:// or socks5h:// for SOCKS5 proxy

Accepts the following formats:

  • hostname:port:username:password

  • username:password:hostname:port

  • username:password@hostname:port