MCPcopy Index your code
hub / github.com/python-websockets/websockets / Proxy

Class Proxy

src/websockets/proxy.py:18–45  ·  view source on GitHub ↗

Proxy address. Attributes: scheme: ``"socks5h"``, ``"socks5"``, ``"socks4a"``, ``"socks4"``, ``"https"``, or ``"http"``. host: Normalized to lower case. port: Always set even if it's the default. username: Available when the proxy address contain

Source from the content-addressed store, hash-verified

16
17@dataclasses.dataclass
18class Proxy:
19 """
20 Proxy address.
21
22 Attributes:
23 scheme: ``"socks5h"``, ``"socks5"``, ``"socks4a"``, ``"socks4"``,
24 ``"https"``, or ``"http"``.
25 host: Normalized to lower case.
26 port: Always set even if it's the default.
27 username: Available when the proxy address contains `User Information`_.
28 password: Available when the proxy address contains `User Information`_.
29
30 .. _User Information: https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1
31
32 """
33
34 scheme: str
35 host: str
36 port: int
37 username: str | None = None
38 password: str | None = None
39
40 @property
41 def user_info(self) -> tuple[str, str] | None:
42 if self.username is None:
43 return None
44 assert self.password is not None
45 return (self.username, self.password)
46
47
48def parse_proxy(proxy: str) -> Proxy:

Callers 2

parse_proxyFunction · 0.85
test_proxy.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…