Hacked By AnonymousFox

Current Path : /opt/alt/python38/lib/python3.8/site-packages/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib/python3.8/site-packages/__pycache__/sockshandler.cpython-38.pyc

U

"�@Wa�	@s&dZddlZzddlZddlZWn,ek
rLddlmZddlmZYnXddl	Z	dd�Z
Gdd�dej�ZGdd�dej
�ZGd	d
�d
ejej�Zedk�r"ddlZzeejd�ZWneefk
r�d
ZYnXe�ee	jde��Zede�d������ede�d������dS)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...
�NcCs|��}|�|�|S�N)�copy�update)�a�b�d�r�=/opt/alt/python38/lib/python3.8/site-packages/sockshandler.py�
merge_dicts
r
c@seZdZddd�Zdd�ZdS)�SocksiPyConnectionNTc	Os*||||||f|_tjj|f|�|�dSr)�	proxyargs�httplib�HTTPConnection�__init__�	�selfZ	proxytypeZ	proxyaddrZ	proxyportZrdns�username�password�args�kwargsrrr	rszSocksiPyConnection.__init__cCsPt��|_|jj|j�t|j�ttfkr8|j�	|j�|j�
|j|jf�dSr)
�socks�
socksocket�sock�setproxyr�type�timeout�int�float�
settimeout�connect�host�port�rrrr	rs

zSocksiPyConnection.connect)NTNN��__name__�
__module__�__qualname__rrrrrr	rs
rc@seZdZddd�Zdd�ZdS)�SocksiPyConnectionSNTc	Os*||||||f|_tjj|f|�|�dSr)rr
�HTTPSConnectionrrrrr	r'szSocksiPyConnectionS.__init__cCs\t��}|j|j�t|j�ttfkr2|�|j�|�	|j
|jf�t�
||j|j�|_dSr)rrrrrrrrrrr r!�sslZwrap_socketZkey_fileZ	cert_filer)rrrrr	r+szSocksiPyConnectionS.connect)NTNNr#rrrr	r'&s
r'c@s$eZdZdd�Zdd�Zdd�ZdS)�SocksiPyHandlercOs||_||_tj�|�dSr)r�kw�urllib2�HTTPHandlerr)rrrrrr	r4szSocksiPyHandler.__init__csd�fdd�	}��||�S)Nrcs(t�j|�}t�j|||d�|��}|S�N)r r!r)r
r+rr�r r!rrr+Zconnr"rr	�build:sz(SocksiPyHandler.http_open.<locals>.build)Nr�Zdo_open�rZreqr0rr"r	�	http_open9szSocksiPyHandler.http_opencsd�fdd�	}��||�S)Nrcs(t�j|�}t�j|||d�|��}|Sr.)r
r+r'rr/r"rr	r0Asz)SocksiPyHandler.https_open.<locals>.build)Nrr1r2rr"r	�
https_open@szSocksiPyHandler.https_openN)r$r%r&rr3r4rrrr	r*3sr*�__main__�iZ#Z	localhostzHTTP: zhttp://httpbin.org/ipzHTTPS: zhttps://httpbin.org/ip) �__doc__r)r,r
�ImportErrorZurllib.requestZrequestZhttp.clientZclientrr
rrr(r'r-ZHTTPSHandlerr*r$�sysr�argvr!�
ValueError�
IndexErrorZbuild_openerZPROXY_TYPE_SOCKS5Zopener�print�open�read�decoderrrr	�<module>s*




Hacked By AnonymousFox1.0, Coded By AnonymousFox