%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/sockshandler.pyc

�
�2;Zc@svdZddlZyddlZddlZWn/ek
r_ddljZddljZnXddl	Z	d�Z
dejfd��YZdej
fd��YZdejejfd	��YZed
krrddlZyeejd�ZWneefk
rdZnXejee	jd
e��Zdejd�j�j�GHdejd�j�j�GHndS(s�
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...
i����NcCs|j�}|j|�|S(N(tcopytupdate(tatbtd((s0/usr/lib/python2.7/site-packages/sockshandler.pyt
merge_dicts
tSocksiPyConnectioncBs&eZdeddd�Zd�ZRS(c	Os5||||||f|_tjj|||�dS(N(t	proxyargsthttplibtHTTPConnectiont__init__(	tselft	proxytypet	proxyaddrt	proxyporttrdnstusernametpasswordtargstkwargs((s0/usr/lib/python2.7/site-packages/sockshandler.pyR
scCsstj�|_|jj|j�t|j�ttfkrS|jj	|j�n|jj
|j|jf�dS(N(
tsockst
socksockettsocktsetproxyRttypettimeouttinttfloatt
settimeouttconnectthosttport(R((s0/usr/lib/python2.7/site-packages/sockshandler.pyRs
N(t__name__t
__module__tNonetTrueR
R(((s0/usr/lib/python2.7/site-packages/sockshandler.pyRstSocksiPyConnectionScBs&eZdeddd�Zd�ZRS(c	Os5||||||f|_tjj|||�dS(N(RRtHTTPSConnectionR
(	RRR
RRRRRR((s0/usr/lib/python2.7/site-packages/sockshandler.pyR
'scCs�tj�}|j|j�t|j�ttfkrJ|j|j�n|j	|j
|jf�tj
||j|j�|_dS(N(RRRRRRRRRRRRtssltwrap_sockettkey_filet	cert_fileR(RR((s0/usr/lib/python2.7/site-packages/sockshandler.pyR+sN(R R!R"R#R
R(((s0/usr/lib/python2.7/site-packages/sockshandler.pyR$&stSocksiPyHandlercBs#eZd�Zd�Zd�ZRS(cOs&||_||_tjj|�dS(N(Rtkwturllib2tHTTPHandlerR
(RRR((s0/usr/lib/python2.7/site-packages/sockshandler.pyR
4s		cs%dd�fd�}�j||�S(Nic	s:t�j|�}td|d|d|�j|�}|S(NRRR(RR+RR(RRRRR+tconn(R(s0/usr/lib/python2.7/site-packages/sockshandler.pytbuild:s$(R"tdo_open(RtreqR/((Rs0/usr/lib/python2.7/site-packages/sockshandler.pyt	http_open9scs%dd�fd�}�j||�S(Nic	s:t�j|�}td|d|d|�j|�}|S(NRRR(RR+R$R(RRRRR+R.(R(s0/usr/lib/python2.7/site-packages/sockshandler.pyR/As$(R"R0(RR1R/((Rs0/usr/lib/python2.7/site-packages/sockshandler.pyt
https_open@s(R R!R
R2R3(((s0/usr/lib/python2.7/site-packages/sockshandler.pyR*3s		t__main__iiZ#t	localhostsHTTP: shttp://httpbin.org/ipsHTTPS: shttps://httpbin.org/ip(t__doc__R&R,RtImportErrorturllib.requesttrequestthttp.clienttclientRRR	RR%R$R-tHTTPSHandlerR*R tsysRtargvRt
ValueErrort
IndexErrortbuild_openertPROXY_TYPE_SOCKS5topenertopentreadtdecode(((s0/usr/lib/python2.7/site-packages/sockshandler.pyt<module>	s*
	



Zerion Mini Shell 1.0