+
    7i~                        R t ^ RIt^ RIt ^ RIt^ RIt^ RI
t
R tR t]! 4       t ! R R]P                  4      t ! R R]P"                  4      t ! R R	]P&                  ]P(                  4      t]R
8X  d   ^ RIt ]! ]P2                  ^,          4      t]P:                  ! ]! ]
P<                  R]4      4      t] ! R]PC                  R4      PE                  4       PG                  4       ,           4       ] ! R]PC                  R4      PE                  4       PG                  4       ,           4       R# R#   ] d    ^ RIHt ^ RIH	t  EL2i ; i  ]]3 d    Rt Li ; i)z
SocksiPy + urllib2 handler

version: 0.3
author: e<e@tr0ll.in>

This module provides a Handler which you can use with urllib2 to allow it to tunnel your connection through a socks.sockssocket socket, with out monkey patching the original socket...
Nc                 H    V P                  4       pVP                  V4       V# N)copyupdate)abds   && ,lib/python3.14/site-packages/sockshandler.py
merge_dictr
      s    	AHHQKH    c                      R V 9   d(   \         P                  ! \         P                  V 4       R# RV 9   d   \         P                  ! V 4       R# R#     R# ; i):.FT)socket	inet_ptonAF_INET6	inet_aton)ss   &r	   is_ipr      sR    
!8V__a0  AXQ 	 s   ,A A Ac                   0   a  ] tR t^*t o RR ltR tRtV tR# )SocksiPyConnectionNc                b    WW4WV3V n         \        P                  P                  ! V .VO5/ VB  R # r   )	proxyargshttplibHTTPConnection__init__	self	proxytype	proxyaddr	proxyportrdnsusernamepasswordargskwargss	   &&&&&&&*,r	   r   SocksiPyConnection.__init__+   s.    #	T''>t>v>r   c                   V P                   w  rr4rVT;'       d
    V\        9  p  \        P                  ! V P                  V P
                  3V P                  RWW4WV\        P                  \        P                  ^334
      p Ypn        R#   \        P                   dW   pT'       dI   R\        T4      9   d9   \        T P                  4      '       g   Rp\        P                  T4        Rp?K  h Rp?ii ; i)TN0x5bF)r   socks4_no_rdnssockscreate_connectionhostporttimeoutr   IPPROTO_TCPTCP_NODELAYSOCKS4Errorstrr   addsock)	r   r   r   r    r!   r"   r#   r4   es	   &        r	   connectSocksiPyConnection.connect/   s    FJnnCy77	7..YY		*DLL$)8((&*<*<a@BD  	 $$ Fc!f,U4995E5E !D"&&y11s   AB C6 A
C10C11C6r   r4   NTNN__name__
__module____qualname____firstlineno__r   r6   __static_attributes____classdictcell____classdict__s   @r	   r   r   *   s     ? r   r   c                   0   a  ] tR t^Ct o RR ltR tRtV tR# )SocksiPyConnectionSNc                b    WW4WV3V n         \        P                  P                  ! V .VO5/ VB  R # r   )r   r   HTTPSConnectionr   r   s	   &&&&&&&*,r	   r   SocksiPyConnectionS.__init__D   s.    #	T((???r   c                   \         P                  V 4       V P                  P                  V P                  V P
                  R 7      V n        V P                  P                  '       gQ   V P                  '       d=    \        P                  ! V P                  P                  4       V P
                  4       R# R# R#   \         dF    T P                  P                  \        P                  4       T P                  P                  4        h i ; i))server_hostnameN)r   r6   _contextwrap_socketr4   r,   check_hostname_check_hostnamesslmatch_hostnamegetpeercert	Exceptionshutdownr   	SHUT_RDWRclose)r   s   &r	   r6   SocksiPyConnectionS.connectH   s    ""4(MM--dii-S	}}+++0D0D0D""499#8#8#:DIIF 1E+  		""6#3#34		!s   ;9B: :AD
r8   r9   r:   rA   s   @r	   rD   rD   C   s     @	 	r   rD   c                   2   a  ] tR t^St o R tR tR tRtV tR# )SocksiPyHandlerc                \    Wn         W n        \        P                  P	                  V 4       R # r   )r$   kwurllib2HTTPHandlerr   )r   r$   r%   s   &*,r	   r   SocksiPyHandler.__init__T   s     	$$T*r   c                6   a  RV 3R llpS P                  W!4      # )Nc           	      j   < \        SP                  V4      p\        SP                  R V RVRV/VB pV# r,   r-   r.   )r
   rY   r   r$   r,   r-   r.   r%   rY   connr   s   &&&,  r	   build(SocksiPyHandler.http_open.<locals>.buildZ   s<    DGGV,B%tyy^t^$^PW^[]^DKr   N    do_openr   reqrb   s   f& r	   	http_openSocksiPyHandler.http_openY       	 ||E''r   c                6   a  RV 3R llpS P                  W!4      # )Nc           	      j   < \        SP                  V4      p\        SP                  R V RVRV/VB pV# r_   )r
   rY   rD   r$   r`   s   &&&,  r	   rb   )SocksiPyHandler.https_open.<locals>.builda   s<    DGGV,B&		__4_QX_\^_DKr   rd   rf   rh   s   f& r	   
https_openSocksiPyHandler.https_open`   rl   r   )r$   rY   N)	r;   r<   r=   r>   r   rj   rp   r?   r@   rA   s   @r	   rW   rW   S   s     +
(( (r   rW   __main__iZ#  	localhostzHTTP: zhttp://httpbin.org/ipzHTTPS: zhttps://httpbin.org/ip)$__doc__r   rN   rZ   r   ImportErrorurllib.requestrequesthttp.clientclientr*   r
   r   setr)   r   r   rF   rD   r[   HTTPSHandlerrW   r;   sysintargvr-   
ValueError
IndexErrorbuild_openerPROXY_TYPE_SOCKS5openerprintopenreaddecode r   r	   <module>r      sF    
"
 
 // 2'11  (g))7+?+? (( z388A; !!/%2I2I;X\"]^F	(V[[!89>>@GGI
IJ	)fkk":;@@BIIK
KL o  "$!!"v 
# s#   D0 ;E
 0EE
EE