U
    mh	                  	   @   sl   d dl Z d dlZd dlmZmZ d dlmZ dejddddddddd	Zdejdddddddd
dZ	dS )    N)	ProxyTypeparse_proxy_url)Proxyz	127.0.0.1i8  T)
proxy_type
proxy_host
proxy_portusernamepasswordrdnsloopc             	      s   t jdtdd |d ks |d kr(td|	d kr8t }	| d k	rRt| \}}}}}tj|||||||	d}|	||I d H }tj
f d d |d|
I d H S )Nz^open_connection is deprecated. Use https://github.com/romis2012/python-socks directly instead.   
stacklevelhost and port must be specifiedr   hostportr   r	   r
   r   )r   r   sock)warningswarnDeprecationWarning
ValueErrorasyncioget_event_loopr   r   createconnectopen_connection)	proxy_urlr   r   r   r   r   r   r	   r
   r   kwargsproxyr    r    [/var/www/html/peyman_registration/venvv2/lib/python3.8/site-packages/aiohttp_socks/utils.pyr      s,    
r   c             	      s   t jdtdd |d kr td|d ks0|d kr8td|
d krHt }
| d k	rbt| \}}}}}tj||||||	|
d}|	||I d H }|
j
f |d d |d|I d H S )Nz`create_connection is deprecated. Use https://github.com/romis2012/python-socks directly instead.r   r   z"protocol_factory must be specifiedr   r   )protocol_factoryr   r   r   )r   r   r   r   r   r   r   r   r   r   create_connection)r   r"   r   r   r   r   r   r   r	   r
   r   r   r   r   r    r    r!   r#   6   s>    
   r#   )NNN)NNNN)
r   r   python_socksr   r   python_socks.async_.asyncior   SOCKS5r   r#   r    r    r    r!   <module>   s8      /    