import socket
from _typeshed import Incomplete

PROXY_TYPE_SOCKS4: int
PROXY_TYPE_SOCKS5: int
PROXY_TYPE_HTTP: int
PROXY_TYPE_HTTP_NO_TUNNEL: int

class ProxyError(Exception): ...
class GeneralProxyError(ProxyError): ...
class Socks5AuthError(ProxyError): ...
class Socks5Error(ProxyError): ...
class Socks4Error(ProxyError): ...
class HTTPError(ProxyError): ...

def setdefaultproxy(
    proxytype: Incomplete | None = None,
    addr: Incomplete | None = None,
    port: Incomplete | None = None,
    rdns: bool = True,
    username: Incomplete | None = None,
    password: Incomplete | None = None,
) -> None: ...
def wrapmodule(module) -> None: ...

class socksocket(socket.socket):
    def __init__(self, family=..., type=..., proto: int = 0, _sock: Incomplete | None = None) -> None: ...
    def sendall(self, content, *args): ...
    def setproxy(
        self,
        proxytype: Incomplete | None = None,
        addr: Incomplete | None = None,
        port: Incomplete | None = None,
        rdns: bool = True,
        username: Incomplete | None = None,
        password: Incomplete | None = None,
        headers: Incomplete | None = None,
    ) -> None: ...
    def getproxysockname(self): ...
    def getproxypeername(self): ...
    def getpeername(self): ...
    def connect(self, destpair) -> None: ...
