⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.
2013-present by Abhinav Singh and contributors.
BSD, see LICENSE for more details.
- class proxy.http.url.Url(scheme: Optional[bytes] = None, username: Optional[bytes] = None, password: Optional[bytes] = None, hostname: Optional[bytes] = None, port: Optional[int] = None, remainder: Optional[bytes] = None)[source]#
urllib.urlparsedoesn’t work for proxy.py, so we wrote a simple URL.
Currently, URL only implements what is necessary for HttpParser to work.
- classmethod from_bytes(raw: bytes, allowed_url_schemes: Optional[List[bytes]] = None) proxy.http.url.Url [source]#
A URL within proxy.py core can have several styles, because proxy.py supports both proxy and web server use cases.
Example: For a Web server, url is like
/get?key=valueFor a HTTPS connect tunnel, url is like
httpbin.org:443For a HTTP proxy request, url is like
proxy.py internally never expects a https scheme in the request line. But
Urlclass provides support for parsing any scheme present in the URLs. e.g. ftp, icap etc.
If a url with no scheme is parsed, e.g.
//host/abc.js, then scheme defaults to
Further: 1) URL may contain unicode characters 2) URL may contain IPv4 and IPv6 format addresses instead of domain names