/usr/lib/python3.9/site-packages/__pycache__
NameSizeModeActions
distro.cpython-39.opt-1.pyc367770644editdlrm
distro.cpython-39.pyc368300644editdlrm
hwdata.cpython-39.opt-1.pyc46680644editdlrm
hwdata.cpython-39.pyc46680644editdlrm
pyinotify.cpython-39.opt-1.pyc768440644editdlrm
pyinotify.cpython-39.pyc769660644editdlrm
pyparsing.cpython-39.opt-1.pyc2403580644editdlrm
pyparsing.cpython-39.pyc2403580644editdlrm
seobject.cpython-39.opt-1.pyc850950644editdlrm
seobject.cpython-39.pyc850950644editdlrm
six.cpython-39.opt-1.pyc271980644editdlrm
six.cpython-39.pyc271980644editdlrm
socks.cpython-39.opt-1.pyc213680644editdlrm
socks.cpython-39.pyc213680644editdlrm
sockshandler.cpython-39.opt-1.pyc42190644editdlrm
sockshandler.cpython-39.pyc42190644editdlrm
Edit: /usr/lib/python3.9/site-packages/__pycache__/socks.cpython-39.pyc (21368B)
a G2„]nyã @srddlmZzddlmZWney:ddlmZYn0ddlmZmZm Z ddl Z ddl m Z ddl Z ddlZddlmZddlZddlZddlZdZejdkrØejd krØz ddlZWneyÖed ƒ‚Yn0e  e¡Zd ZZd ZZd ZZeeedœZ e!e"e  #¡e  $¡ƒƒZ%ejZ&Z'dd„Z(Gdd„de)ƒZ*Gdd„de*ƒZ+Gdd„de*ƒZ,Gdd„de*ƒZ-Gdd„de*ƒZ.Gdd„de*ƒZ/Gdd„de*ƒZ0dd d!d"œZ1d#d$d%d&d'd(d)d*d+œZ2ed,ed,ed-iZ3d@d/d0„Z4d1d2„Z5d3d4„Z6e6Z7d5d6„Z8e8Z9dAd7d8„Z:Gd9d:„d:ejƒZ;d;d<„Ze?e>eƒ�s"e;j@ Ae¡eBe;eed?„d?e;ƒZCdS)Bé)Ú b64encode)ÚCallable)Ú EOPNOTSUPPÚEINVALÚEAGAINN)ÚBytesIO)ÚSEEK_CURz1.7.1Únt)érz8To run PySocks on Windows you must install win_inet_ptonéér )ÚSOCKS4ÚSOCKS5ÚHTTPcst ˆ¡‡fdd„ƒ}|S)Nc sž|d}z|z>| ¡}|dkr&| d¡ˆ|i|¤ŽWW|dkrH| d¡Styn}z‚WYd}~n d}~00W|dkrš| d¡n|dkr˜| d¡0dS)NrTF)Ú gettimeoutÚ setblockingÚ Exception)ÚargsÚkwargsÚselfZ _is_blockingÚe©Úfunction©ú)/usr/lib/python3.9/site-packages/socks.pyÚwrapper(s  ú ÿz"set_self_blocking..wrapper)Ú functoolsÚwraps)rrrrrÚset_self_blocking&s rc@s"eZdZdZddd„Zdd„ZdS)Ú ProxyErrorz4Socket_err contains original socket.error exception.NcCs(||_||_|r$|jd |¡7_dS)Nz: {})ÚmsgÚ socket_errÚformat)rr r!rrrÚ__init__;szProxyError.__init__cCs|jS©N)r ©rrrrÚ__str__BszProxyError.__str__)N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r#r&rrrrr9s rc@s eZdZdS)ÚGeneralProxyErrorN©r'r(r)rrrrr+Fsr+c@s eZdZdS)ÚProxyConnectionErrorNr,rrrrr-Jsr-c@s eZdZdS)ÚSOCKS5AuthErrorNr,rrrrr.Nsr.c@s eZdZdS)Ú SOCKS5ErrorNr,rrrrr/Rsr/c@s eZdZdS)Ú SOCKS4ErrorNr,rrrrr0Vsr0c@s eZdZdS)Ú HTTPErrorNr,rrrrr1Zsr1zRequest rejected or failedzLRequest rejected because SOCKS server cannot connect to identd on the clientzPRequest rejected because the client program and identd report different user-ids)é[é\é]zGeneral SOCKS server failurez!Connection not allowed by rulesetzNetwork unreachablezHost unreachablezConnection refusedz TTL expiredz(Command not supported, or protocol errorzAddress type not supported)r r r éééééi8i�TcCs.|||||r| ¡nd|r"| ¡ndft_dS)z›Sets a default proxy. All further socksocket objects will use the default unless explicitly changed. All parameters are as for socket.set_proxy().N)ÚencodeÚ socksocketÚ default_proxy)Ú proxy_typeÚaddrÚportÚrdnsÚusernameÚpasswordrrrÚset_default_proxyssþrCcOs$d|vr| d¡|d<t|i|¤ŽS©NZ proxytyper=)ÚpoprC)rrrrrÚsetdefaultproxy~srFcCstjS)z4Returns the default proxy, set by set_default_proxy.)r;r<rrrrÚget_default_proxy„srGcCstjrt|j_ntdƒ‚dS)aAttempts to replace a module's socket library with a SOCKS socket. Must set a default proxy using set_default_proxy(...) first. This will only work on modules that import socket directly into the namespace; most of the Python Standard Library falls into this category.zNo default proxy specifiedN)r;r<Úsocketr+)ÚmodulerrrÚ wrap_module‹s rJc  Cs8|\} } |  d¡r|  d¡} |r4| d¡r4| d¡}d} t ||dtj¡D]Ô} | \}}}}}d}zzt|||ƒ}| r†| D]}|j|Žqvt|tt fƒrž|  |¡|r¶|  ||||||¡|rÄ|  |¡|  | | f¡|WStjtf�y}z"|} |�r| ¡d}WYd}~qJd}~00qJ| �r*| ‚t d¡‚dS)aícreate_connection(dest_pair, *[, timeout], **proxy_args) -> socket object Like socket.create_connection(), but connects to proxy before returning the socket object. dest_pair - 2-tuple of (IP/hostname, port). **proxy_args - Same args passed to socksocket.set_proxy() if present. timeout - Optional socket timeout value, in seconds. source_address - tuple (host, port) for the socket to bind to as its source address before connecting (only for compatibility) ú[z[]Nrzgai returned empty list.)Ú startswithÚstriprHÚ getaddrinfoÚ SOCK_STREAMr;Z setsockoptÚ isinstanceÚintÚfloatÚ settimeoutÚ set_proxyÚbindÚconnectÚerrorrÚclose)Ú dest_pairÚtimeoutZsource_addressr=Ú proxy_addrÚ proxy_portZ proxy_rdnsZproxy_usernameZproxy_passwordZsocket_optionsZ remote_hostZ remote_portÚerrÚrÚfamilyZ socket_typeÚprotoZ canonnameZsaZsockÚoptrrrrÚcreate_connection™s@       ÿ  rbc@seZdZdZdd„ZeƒZdS)Ú _BaseSocketzBAllows Python 2 delegated methods such as send() to be overridden.cOsJtj|g|¢Ri|¤Žtƒ|_|jD]}t||ƒ|j|<t||ƒq&dSr$)Ú _orig_socketr#ÚdictÚ _savedmethodsÚ _savenamesÚgetattrÚdelattr)rÚposÚkwÚnamerrrr#Øs  z_BaseSocket.__init__N)r'r(r)r*r#ÚlistrgrrrrrcÖsrccs ‡fdd„S)Ncs|jˆ|i|¤ŽSr$)rf)rrjrk©rlrrÚäóz_makemethod..rrnrrnrÚ _makemethodãsrq)ÚsendtoÚsendÚrecvfromÚrecvcs<eZdZdZdZejejdf‡fdd„ Zdd„Z ‡fdd „Z d d „Z d d „Z d7dd„Z dd„Z‡fdd„Z‡fdd„Zd8‡fdd„ Zd9‡fdd„ Zdd„Z‡fdd„Zdd „ZeZd!d"„ZeZd#d$„ZeZd%d&„Z‡fd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Z e!ee"ee#e iZ$e%d:‡fd1d2„ ƒZ&e%d3d4„ƒZ'd5d6„Z(‡Z)S);r;a2socksocket([family[, type[, proto]]]) -> socket object Open a SOCKS enabled socket. The parameters are the same as those of the standard socket init. In order for SOCKS to work, you must specify family=AF_INET and proto=0. The "type" argument must be either SOCK_STREAM or SOCK_DGRAM. Nrcsv|tjtjfvr"d}t| |¡ƒ‚tt|ƒj|||g|¢Ri|¤Žd|_|j rZ|j |_ nd|_ d|_ d|_ d|_ dS)Nz0Socket type must be stream or datagram, not {!r})NNNNNN)rHrOÚ SOCK_DGRAMÚ ValueErrorr"Úsuperr;r#Ú _proxyconnr<ÚproxyÚproxy_socknameÚproxy_peernameÚ_timeout)rr_Útyper`rrr ©Ú __class__rrr#üs" zsocksocket.__init__cCs<d}t|ƒ|kr8| |t|ƒ¡}|s.tdƒ‚||7}q|S)zŠReceive EXACTLY the number of bytes requested from the file object. Blocks until the required number of bytes have been received.rpúConnection closed unexpectedly)ÚlenÚreadr+)rÚfileÚcountÚdataÚdrrrÚ_readalls  zsocksocket._readallcs>||_z| ¡}tt|ƒ |j¡Wntjy8Yn0dSr$)r}Úget_proxy_peernamerxr;rSrHrW)rrZZpeerrrrrSs zsocksocket.settimeoutcCs|jSr$)r}r%rrrr#szsocksocket.gettimeoutcCs|r| d¡n | d¡dS)Ng)rS)rÚvrrrr&s zsocksocket.setblockingTcCs.|||||r| ¡nd|r"| ¡ndf|_dS)a� Sets the proxy to be used. proxy_type - The type of the proxy to be used. Three types are supported: PROXY_TYPE_SOCKS4 (including socks4a), PROXY_TYPE_SOCKS5 and PROXY_TYPE_HTTP addr - The address of the server (IP or DNS). port - The port of the server. Defaults to 1080 for SOCKS servers and 8080 for HTTP proxy servers. rdns - Should DNS queries be performed on the remote side (rather than the local side). The default is True. Note: This has no effect with SOCKS4 servers. username - Username to authenticate with to the server. The default is no authentication. password - Password to authenticate with to the server. Only relevant when username is also provided.N)r:rz)rr=r>r?r@rArBrrrrT,sþzsocksocket.set_proxycOs&d|vr| d¡|d<|j|i|¤ŽSrD)rErT)rrrrrrÚsetproxyAszsocksocket.setproxycs|j\}}}}}}|r"|jtjkr:tj|g|¢Ri|¤ŽS|jrLt td¡‚|t krdd} t t | ¡‚t t |ƒj|i|¤Ž|  ¡\} } d| f} tƒ|_| ¡} |j | ¡d}| |j|| ¡\} }| \}} |\} } t t |ƒ || f¡t t |ƒ |j¡d|_dS)zVImplements proxy connection for UDP sockets. Happens during the bind() phase.z"Socket already bound to an addressz'UDP only supported by SOCKS5 proxy typeÚ0ó)ú0.0.0.0rN)rzr~rHrvrdrUryrWrrrrxr;Z getsocknameÚ _proxy_addrrVÚ_SOCKS5_requestrSr}r{)rrjrkr=r[r\r@rArBr Ú_r?ÚdstrzZ UDP_ASSOCIATEZrelayÚhostrrrrUFs.ÿ     zsocksocket.bindc s®|jtjkr*tt|ƒj|g|¢Ri|¤ŽS|js:| d¡|d}|dd…}tƒ}d}|  |¡d}|  |¡|  ||¡tt|ƒj |  ¡|g|¢Ri|¤Ž} | |  ¡S)N©Úréÿÿÿÿsó)r~rHrvrxr;rrryrUrÚwriteÚ_write_SOCKS5_addressrsÚgetvalueÚtell) rÚbytesrrZaddressÚflagsÚheaderZRSVZ STANDALONEÚsentrrrrrks       ÿzsocksocket.sendtoc sB|jtjkr$|j|||jfi|¤ŽStt|ƒj||fi|¤ŽSdSr$)r~rHrvrrr|rxr;rs)rrœr�rrrrrss zsocksocket.sendc s¾|jtjkrtt|ƒ ||¡S|js.| d¡ttt|ƒ  |d|¡ƒ}|  dt ¡|  d¡}t |ƒrntdƒ‚| |¡\}}|jr¬|j\}}||ks |d|fvr¬t td¡‚|  |¡||ffS)Nr”ir r zReceived UDP packet fragmentrzPacket filtered)r~rHrvrxr;rtryrUrruÚseekrrƒÚordÚNotImplementedErrorÚ_read_SOCKS5_addressr|rWr) rÚbufsizer�ÚbufÚfragZfromhostZfromportZpeerhostZpeerportrrrrt…s      zsocksocket.recvfromcOs|j|i|¤Ž\}}|Sr$)rt)rrjrkrœr‘rrrru™szsocksocket.recvcs|jr|j ¡tt|ƒ ¡Sr$)ryrXrxr;r%rrrrX�s zsocksocket.closecCs|jS)z:Returns the bound IP address and port number at the proxy.)r{r%rrrÚget_proxy_sockname¢szsocksocket.get_proxy_socknamecCs| ¡S)z> Returns the IP and port number of the proxy. )Ú getpeernamer%rrrr‰¨szsocksocket.get_proxy_peernamecCs|jS)zwReturns the IP address and port number of the destination machine. Note: get_proxy_peername returns the proxy.)r|r%rrrÚ get_peername°szsocksocket.get_peernamecGsd}| |||¡\|_|_dS)z7Negotiates a stream connection through a SOCKS5 server.óN)r�r|r{)rÚ dest_addrZCONNECTrrrÚ_negotiate_SOCKS5¸sÿzsocksocket._negotiate_SOCKS5cs|j\}}}}}} | d¡} | dd¡} �zÔ|r@| r@|  d¡n |  d¡|  ¡| | d¡} | dd…dkrvtd ƒ‚| dd…d k�r|r�| s˜td ƒ‚|  d tt|ƒƒ  ¡|tt| ƒƒ  ¡| ¡|  ¡| | d¡} | dd…d krötd ƒ‚| dd…d k�rHtdƒ‚n6| dd…d k�rH| dd…dk�r@tdƒ‚ntd ƒ‚|  d|d ¡|  || ¡}|  ¡| | d¡}|dd…dk�r”td ƒ‚t |dd…ƒ}|dk�rÊt   |d¡}td ||¡ƒ‚| | ¡}tt|ƒ |j¡||fW|  ¡|  ¡S|  ¡|  ¡0dS)z‘ Send SOCKS5 request with given command (CMD field) and address (DST field). Returns resolved DST address that was used. ÚwbÚrbrssr r óú%SOCKS5 proxy server sent invalid dataózPNo username/password supplied. Server requested username/password authenticationrªr—zSOCKS5 authentication failedóÿz7All offered SOCKS5 authentication methods were rejectedr ú Unknown errorú {:#04x}: {}N)rzÚmakefiler˜Úflushrˆr+r.Úchrr‚r:r™r¡Ú SOCKS5_ERRORSÚgetr/r"r£rxr;rSr}rX)rZconnÚcmdr’r=r>r?r@rArBÚwriterÚreaderZ chosen_authZ auth_statusZresolvedÚrespÚstatusrWZbndrrrr�¾sz     ÿÿþý ÿ ÿÿ  ÿ   ýÿzsocksocket._SOCKS5_requestc CsJ|\}}|j\}}}}}} tjdtjdi} tjtjfD]h} zJt | |¡} | | | | ¡t | | ¡}| t d|¡¡||fWStj yœYq6Yq60q6|rÎ|  d¡} | dt t | ƒƒ  ¡| ¡nbt  ||tjtjtjtj¡}|d}|d} |dd}t | |¡} | | | | ¡t | | ¡}| t d|¡¡||fS)z~ Return the host and port packed for the SOCKS5 protocol, and the resolved address as a tuple object. rªóú>HÚidnar�rr5)rzrHÚAF_INETÚAF_INET6Z inet_ptonr˜Ú inet_ntopÚstructÚpackrWr:r·r‚rNZ AF_UNSPECrOZ IPPROTO_TCPZ AI_ADDRCONFIG)rr>r„r“r?r=r‘r@rArBZfamily_to_byter_Ú addr_bytesZ host_bytesZ addressesZ target_addrrrrr™ s8      ý   z socksocket._write_SOCKS5_addresscCs–| |d¡}|dkr(t | |d¡¡}nN|dkrN| |d¡}| |t|ƒ¡}n(|dkrnt tj| |d¡¡}ntdƒ‚t d| |d ¡¡d }||fS) Nr rªr5r�r¿ér°rÀr r) rˆrHÚ inet_ntoar¡rÄrÃr+rÅÚunpack)rr„Zatypr>Úlengthr?rrrr£Ms  zsocksocket._read_SOCKS5_addresscCsœ|j\}}}}}}| d¡} | dd¡} �zZd} zt |¡} Wn2tjyp|r\d} d} nt t |¡¡} Yn0|  t ddd |¡¡|  | ¡|r |  |¡|  d ¡| rÂ|  |  d ¡d ¡|   ¡|  | d ¡} | dd …d krît d ƒ‚t | d d…ƒ}|dk�r$t |d¡}td ||¡ƒ‚t | dd…¡t d| dd…¡df|_| �rht | ¡|f|_n ||f|_W|  ¡|  ¡n|  ¡|  ¡0dS)z0Negotiates a connection through a SOCKS4 server.r­r®rFsTz>BBHr5r r—rÁr9z%SOCKS4 proxy server sent invalid datar éZr³r´NrÀ)rzrµrHZ inet_atonrWÚ gethostbynamer˜rÅrÆr:r¶rˆr+r¡Ú SOCKS4_ERRORSr¹r0r"rÉrÊr{r|rX)rr«Ú dest_portr=r>r?r@rArBr»r¼Zremote_resolverÇr½r¾rWrrrÚ_negotiate_SOCKS4\sR  ÿ     ÿ  ÿ  ÿzsocksocket._negotiate_SOCKS4cCsf|j\}}}}}}|r|nt |¡}d| d¡dt|ƒ ¡dd| d¡g} |rv|rv|  dt|d|ƒ¡|  d¡| d | ¡¡|  ¡} |   ¡} |   ¡| s´t dƒ‚z|   d d ¡\} } }Wntyät d ƒ‚Yn0|  d ¡søt d ƒ‚z t| ƒ} Wnt�y tdƒ‚Yn0| dk�rRd | |¡}| dv�rJ|d7}t|ƒ‚d|_||f|_dS)zwNegotiates a connection through an HTTP server. NOTE: This currently only supports HTTP CONNECT-style proxies.sCONNECT rÁó:s HTTP/1.1sHost: sProxy-Authorization: basic s r�ú r z'HTTP proxy server sent invalid responsezHTTP/z0Proxy server does not appear to be an HTTP proxyz4HTTP proxy server did not return a valid HTTP statuséÈz{}: {})i�i“i•za [*] Note: The HTTP proxy server may not be supported by PySocks (must be a CONNECT tunnel proxy))s0.0.0.0rN)rzrHrÍr:ÚstrÚappendrZsendallÚjoinrµÚreadlinerXr+ÚsplitrwrLrQr1r"r{r|)rr«rÏr=r>r?r@rArBZ http_headersZfobjZ status_liner`Z status_codeZ status_msgrWrrrÚ_negotiate_HTTP˜sR ÿÿ ýÿ   ÿ ÿ    zsocksocket._negotiate_HTTPc s&t|ƒdks|d d¡r,t dt|ƒ¡‚|\}}|jtjkr||jsP| d¡t  |¡}|dkrn|snd|_ n ||f|_ dS|j \}}}}} } t |t tfƒr¶t|ƒdks¶|r¶t |tƒs¾tdƒ‚tt|ƒ |j¡|du�r ||_ tt|ƒ |j¡tt|ƒ ||f¡dS| ¡}ztt|ƒ |¡Wn|tj�y¢} z`| ¡|�sŠ|\}}d  ||¡} t|} d  | | ¡}t d || ¡t|| ƒ‚n| ‚WYd} ~ nˆd} ~ 00z|j|}||||ƒWnbtj�y} z*|�sì| ¡td | ƒ‚n| ‚WYd} ~ n&d} ~ 0t�y | ¡‚Yn0dS) zã Connects to the specified destination through a proxy. Uses the same API as socket's connect(). To select the proxy server, use set_proxy(). dest_pair - 2-tuple of (IP/hostname, port). r rrKz PySocks doesn't support IPv6: %sr”rŽNz0Invalid destination-connection (host, port) pairz{}:{}zError connecting to {} proxy {}z %s due to: %sz Socket error)r‚rLrHrWrÔr~rvryrUrÍr|rzrPrmÚtuplerQr+rxr;rSr}rVr�rXr"ÚPRINTABLE_PROXY_TYPESÚlogÚdebugr-Ú_proxy_negotiatorsr)rrYÚ catch_errorsr«rÏr=r[r\r@rArBrWZ proxy_serverZprintable_typer Z negotiaterrrrVÙst ÿ     ÿ  ÿþýÿ  ÿ   zsocksocket.connectc CsXz|j|dd�WdStyR}z&|jr<|jWYd}~S‚WYd}~n d}~00dS)a& https://docs.python.org/3/library/socket.html#socket.socket.connect_ex Like connect(address), but return an error indicator instead of raising an exception for errors returned by the C-level connect() call (other problems, such as "host not found" can still raise exceptions). T)rßrN)rVÚOSErrorÚerrno)rrYrrrrÚ connect_ex6szsocksocket.connect_excCs4|j\}}}}}}|pt |¡}|s,tdƒ‚||fS)zD Return proxy address to connect to as tuple object zInvalid proxy type)rzÚ DEFAULT_PORTSr¹r+)rr=r[r\r@rArBrrrr�Fsÿ zsocksocket._proxy_addr)NNNTNN)r)r)N)*r'r(r)r*r<rHrÂrOr#rˆrSrrrTr‹rUrrrsrtrurXr§Zgetproxysocknamer‰Zgetproxypeernamer©r¨r¬r�r™r£rÐrÙr rrrÞrrVrâr�Ú __classcell__rrrrr;ñsPÿ ÿ  %   b-<<ý\ r;)NNNTNN) NNNNNTNNN)DÚbase64rÚcollections.abcrÚ ImportErrorÚ collectionsrárrrrÚiorZloggingÚosrrHrÅÚsysÚ __version__rlÚ version_infoZ win_inet_ptonZ getLoggerr'rÜZPROXY_TYPE_SOCKS4r ZPROXY_TYPE_SOCKS5rZPROXY_TYPE_HTTPrZ PROXY_TYPESreÚzipÚvaluesÚkeysrÛZ _orgsocketrdrÚIOErrorrr+r-r.r/r0r1rÎr¸rãrCrFrGZgetdefaultproxyrJZ wrapmodulerbrcrqrhÚmethodrPrgrÕÚsetattrr;rrrrÚs�      ÿ     ü ø ÿ  û =