+
    ÃHàjž  ã                   ó4  € ^ RI t ^ RIt^RIHt ^RIHtHt ^RIHtH	t	H
t
Ht  ! R R]] P                  4      t ! R R]] P                  4      t ! R	 R
]P                   4      t ! R R]P                   4      t ! R R]P                   4      t ! R R4      tR# )é    N)Ú
StrOrBytes)ÚProtocolErrorÚ
SOCKSError)ÚAddressTypeÚdecode_addressÚencode_addressÚ#get_address_port_tuple_from_addressc                   ó*   € ] tR t^tRtRtRtRtRtRt	R# )ÚSOCKS4ReplyCodez"Enumeration of SOCKS4 reply codes.ó   Zó   [ó   \ó   ]© N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚREQUEST_GRANTEDÚREQUEST_REJECTED_OR_FAILEDÚCONNECTION_FAILEDÚAUTHENTICATION_FAILEDÚ__static_attributes__r   ó    Ú�/home/ubuntu/.hermes/installs/5f0a1ff4045d044e/environments/88679baa1dc64374a0cd943b62eeefb9/venv/lib/python3.14/site-packages/socksio/socks4.pyr   r      s   † Ù,à€OØ!(ÐØÐØ#Ôr   r   c                   ó"   € ] tR t^tRtRtRtRtR# )ÚSOCKS4Commandz$Enumeration of SOCKS4 command codes.ó   ó   r   N)r   r   r   r   r   ÚCONNECTÚBINDr   r   r   r   r   r      s   † Ù.à€GØ„Dr   r   c                   ój   a € ] tR t^t o RtRt]R	V 3R lR ll4       tR	V 3R lR lltV 3R lt	Rt
V tR# )
ÚSOCKS4RequestaN  Encapsulates a request to the SOCKS4 proxy server

Args:
    command: The command to request.
    port: The port number to connect to on the target host.
    addr: IP address of the target host.
    user_id: Optional user ID to be included in the request, if not supplied
        the user *must* provide one in the packing operation.
Nc                ó¨   <€ V ^8„  d   QhRS[ RS[P                  S[S[P                  S[S[3,          3,          RS[P                  S[,          RR/# )é   ÚcommandÚaddressÚuser_idÚreturnr$   ©r   ÚtypingÚUnionr   ÚTupleÚintÚOptionalÚbytes)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚSOCKS4Request.__annotate__/   s]   ø€ ÷ Sñ SáðSñ —‘™j©&¯,©,±zÁ3°Õ*GÐGÕHðSñ —‘¡Õ'ð	Sð
 
ñSr   c                óŠ   € \        V4      w  r$\        V4      w  rVV\        P                  8w  d   \	        R4      hV ! WWCR7      # )aj  Convenience class method to build an instance from command and address.

Args:
    command: The command to request.
    address: A string in the form 'HOST:PORT' or a tuple of ip address string
        and port number.
    user_id: Optional user ID.

Returns:
    A SOCKS4Request instance.

Raises:
    SOCKSError: If a domain name or IPv6 address was supplied.
z;IPv6 addresses and domain names are not supported by SOCKS4©r'   ÚaddrÚportr)   )r	   r   r   ÚIPV4r   ©Úclsr'   r(   r)   r9   ÚatypeÚencoded_addrs   &&&&   r   Úfrom_addressÚSOCKS4Request.from_address.   sJ   € ô* <¸GÓD‰ˆÜ,¨WÓ5ÑˆØ”K×$Ñ$Ô$ÜØMóð ñ ˜7¸DÔRÐRr   c                óJ   <€ V ^8„  d   QhRS[ P                  S[,          RS[/# ©r&   r)   r*   ©r,   r0   r1   )r2   r3   s   "€r   r4   r5   K   s$   ø€ ÷ 
ñ 
™VŸ_™_©UÕ3ð 
¹uñ 
r   c           	     óØ   € T;'       g    V P                   pVf   \        R4      hRP                  RV P                  V P                  P                  ^RR7      V P                  VR.4      # )áZ  Packs the instance into a raw binary in the appropriate form.

Args:
    user_id: Optional user ID as an override, if not provided the instance's
        will be used, if none was provided at initialization an error is raised.

Returns:
    The packed request.

Raises:
    SOCKSError: If no user was specified in this call or on initialization.
ú-SOCKS4 requires a user_id, none was specifiedr   ó   Úbig©Ú	byteorderó    ©r)   r   Újoinr'   r9   Úto_bytesr8   ©Úselfr)   s   &&r   ÚdumpsÚSOCKS4Request.dumpsK   sj   € ð ×)Ð)˜TŸ\™\ˆØŠ?ÜÐLÓMÐMà�x‰xàØ—‘Ø—‘×$Ñ$ Q°%Ð$Ó8Ø—	‘	ØØðó	
ð 		
r   c                ón   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[;R&   S[P                  S[,          ;R&   # ©r&   r'   r9   r8   r)   ©r   r/   r1   r,   r0   )r2   r3   s   "€r   r4   r5      ó@   ø‡ ‚ ñ Ññ ñ �Iñ ñ �Kñ ñ �_‰_™UÕ#Ñ*ò r   r   ©N©r   r   r   r   r   r)   Úclassmethodr?   rQ   Ú__annotate_func__r   Ú__classdictcell__©r3   s   @r   r$   r$      s=   ø‡ € ñð '+€Gà÷Sñ Só ðS÷8
ò 
÷[ ƒ r   r$   c                   ój   a € ] tR t^ht o RtRt]R	V 3R lR ll4       tR	V 3R lR lltV 3R lt	Rt
V tR# )
ÚSOCKS4ARequestaO  Encapsulates a request to the SOCKS4A proxy server

Args:
    command: The command to request.
    port: The port number to connect to on the target host.
    addr: IP address of the target host.
    user_id: Optional user ID to be included in the request, if not supplied
        the user *must* provide one in the packing operation.
Nc                ó¨   <€ V ^8„  d   QhRS[ RS[P                  S[S[P                  S[S[3,          3,          RS[P                  S[,          RR/# )r&   r'   r(   r)   r*   r^   r+   )r2   r3   s   "€r   r4   ÚSOCKS4ARequest.__annotate__y   s]   ø€ ÷ Sñ SáðSñ —‘™j©&¯,©,±zÁ3°Õ*GÐGÕHðSñ —‘¡Õ'ð	Sð
 
ñSr   c                óJ   € \        V4      w  r$\        V4      w  rVV ! WWCR7      # )a#  Convenience class method to build an instance from command and address.

Args:
    command: The command to request.
    address: A string in the form 'HOST:PORT' or a tuple of ip address string
        and port number.
    user_id: Optional user ID.

Returns:
    A SOCKS4ARequest instance.
r7   )r	   r   r;   s   &&&&   r   r?   ÚSOCKS4ARequest.from_addressx   s*   € ô$ <¸GÓD‰ˆÜ,¨WÓ5ÑˆÙ˜7¸DÔRÐRr   c                óJ   <€ V ^8„  d   QhRS[ P                  S[,          RS[/# rB   rC   )r2   r3   s   "€r   r4   r`   Ž   s$   ø€ ÷ 
ñ 
™VŸ_™_©UÕ3ð 
¹uñ 
r   c           
     óÜ   € T;'       g    V P                   pVf   \        R4      hRP                  RV P                  V P                  P                  ^RR7      RVRV P                  R.4      # )rE   rF   r   rG   rH   rI   s      ÿrK   rL   rO   s   &&r   rQ   ÚSOCKS4ARequest.dumpsŽ   sp   € ð ×)Ð)˜TŸ\™\ˆØŠ?ÜÐLÓMÐMà�x‰xàØ—‘Ø—‘×$Ñ$ Q°%Ð$Ó8Ø#ØØØ—	‘	Øð	ó
ð 	
r   c                ón   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[;R&   S[P                  S[,          ;R&   # rT   rU   )r2   r3   s   "€r   r4   r`   h   rV   r   r   rW   rX   r\   s   @r   r^   r^   h   s=   ø‡ € ñð '+€Gà÷Sñ Só ðS÷*
ò 
÷M ƒ r   r^   c                   óL   a € ] tR t^­t o Rt]V 3R lR l4       tV 3R ltRtV t	R# )ÚSOCKS4Replyz¾Encapsulates a reply from the SOCKS4 proxy server

Args:
    reply_code: The code representing the type of reply.
    port: The port number returned.
    addr: Optional IP address returned.
c                ó$   <€ V ^8„  d   QhRS[ RR/# )r&   Údatar*   rh   ©r1   )r2   r3   s   "€r   r4   ÚSOCKS4Reply.__annotate__»   s   ø€ ÷ <ñ <™ð < =ñ <r   c           	     ó@  € \        V4      ^8w  g   VR,          R8w  d   \        R4      h V ! \        VR,          4      \        P	                  VR,          RR7      \        \        P                  VR,          4      R	7      #   \         d   p\        R4      ThR
p?ii ; i)z•Unpacks the reply data into an instance.

Returns:
    The unpacked reply instance.

Raises:
    ProtocolError: If the data does not match the spec.
:r   é   NrK   zMalformed reply:rn   r&   N:r&   é   NrH   rI   :ro   é   N)Ú
reply_coder9   r8   N)	Úlenr   r   r/   Ú
from_bytesr   r   r:   Ú
ValueError)r<   rj   Úexcs   && r   ÚloadsÚSOCKS4Reply.loadsº   sŒ   € ô ˆt‹9˜Œ>˜T #�Y¨'Ô1ÜÐ 1Ó2Ð2ð	<ÙÜ*¨4°­9Ó5Ü—^‘^ D¨¥I¸�^Ó?Ü#¤K×$4Ñ$4°d¸3µiÓ@ôð øô
 ô 	<ÜÐ 1Ó2¸Ð;ûð	<ús   «AB ÂBÂBÂBc                ób   <€ V ^8„  d   Qh/ S[ ;R&   S[;R&   S[P                  S[,          ;R&   # )r&   rq   r9   r8   )r   r/   r,   r0   Ústr)r2   r3   s   "€r   r4   rl   ­   s4   ø‡ ‚ ñ  Ññ ñ �Iñ ñ �/‰/™#Õ
Ñò r   r   N)
r   r   r   r   r   rY   rv   rZ   r   r[   r\   s   @r   rh   rh   ­   s%   ø‡ € ñð ÷<ó ð<÷ ƒ r   rh   c                   ól   a € ] tR t^Ñt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltR
t	V t
R# )ÚSOCKS4ConnectionzäEncapsulates a SOCKS4 and SOCKS4A connection.

Packs request objects into data suitable to be send and unpacks reply
data into their appropriate reply objects.

Args:
    user_id: The user ID to be sent as part of the requests.
c                ó    <€ V ^8„  d   QhRS[ /# )r&   r)   rk   )r2   r3   s   "€r   r4   ÚSOCKS4Connection.__annotate__Û   s   ø€ ÷ *ñ *¡ñ *r   c                óN   € Wn         \        4       V n        \        4       V n        R # rW   )r)   Ú	bytearrayÚ_data_to_sendÚ_received_datarO   s   &&r   Ú__init__ÚSOCKS4Connection.__init__Û   s   € ØŒä&›[ˆÔÜ'›kˆÖr   c                óN   <€ V ^8„  d   QhRS[ P                  S[S[3,          RR/# )r&   Úrequestr*   N)r,   r-   r$   r^   )r2   r3   s   "€r   r4   r}   á   s)   ø€ ÷ =ñ =™FŸL™L©¹Ð)FÕGð =ÈDñ =r   c                ó˜   € VP                   ;'       g    V P                   pV ;P                  VP                  VR7      ,          un        R# )zsPacks a request object and adds it to the send data buffer.

Args:
    request: The request instance to be packed.
)r)   N)r)   r€   rQ   )rP   r…   r)   s   && r   ÚsendÚSOCKS4Connection.sendá   s5   € ð —/‘/×1Ð1 T§\¡\ˆØ×Ò˜gŸm™m°G˜mÓ<Õ<×r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# )r&   rj   r*   )r1   rh   )r2   r3   s   "€r   r4   r}   ê   s   ø€ ÷ 
=ñ 
=¡ð 
=©;ñ 
=r   c                ó„   € V ;P                   V,          un         \        P                  \        V P                   4      4      # )z•Unpacks response data into a reply object.

Args:
    data: The raw response data from the proxy server.

Returns:
    The appropriate reply object.
)r�   rh   rv   r1   ©rP   rj   s   &&r   Úreceive_dataÚSOCKS4Connection.receive_dataê   s1   € ð 	×Ò˜tÕ#ÕÜ× Ñ ¤ t×':Ñ':Ó!;Ó<Ð<r   c                ó    <€ V ^8„  d   QhRS[ /# )r&   r*   rk   )r2   r3   s   "€r   r4   r}   ö   s   ø€ ÷ ñ ™eñ r   c                óN   € \        V P                  4      p\        4       V n        V# )zaReturns the data to be sent via the I/O library of choice.

Also clears the connection's buffer.
)r1   r€   r   r‹   s   & r   Údata_to_sendÚSOCKS4Connection.data_to_sendö   s#   € ô
 �T×'Ñ'Ó(ˆÜ&›[ˆÔØˆr   )r€   r�   r)   N)r   r   r   r   r   r‚   r‡   rŒ   r�   r   r[   r\   s   @r   r{   r{   Ñ   s2   ø‡ € ñ÷*ð *÷=ð =÷
=ð 
=÷ö r   r{   )Úenumr,   Ú_typesr   Ú
exceptionsr   r   Úutilsr   r   r   r	   r1   ÚEnumr   r   Ú
NamedTupler$   r^   rh   r{   r   r   r   Ú<module>r˜      s†   ðÛ Û å ß 1÷ó ô$�e˜TŸY™Yô $ô�E˜4Ÿ9™9ô ôG
�F×%Ñ%ô G
ôTB
�V×&Ñ&ô B
ôJ!<�&×#Ñ#ô !<÷H,ó ,r   