HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/protocols/__pycache__/portforward.cpython-38.pyc
U


W[O	�@svdZddlmZddlmZGdd�dej�ZGdd�de�ZGdd	�d	ej�Z	Gd
d�de�Z
Gdd
�d
ej�ZdS)z
A simple port forwarder.
�)�protocol)�logc@s,eZdZdZdZdd�Zdd�Zdd�ZdS)	�ProxyTNcCs
||_dS�N)�peer)�selfr�r�?/usr/lib/python3/dist-packages/twisted/protocols/portforward.py�setPeersz
Proxy.setPeercCs8|jdk	r|jj��d|_n|jr4t�d|f�dS)NzUnable to connect to peer: %s)r�	transport�loseConnection�noisyr�msg)r�reasonrrr	�connectionLosts

zProxy.connectionLostcCs|jj�|�dSr)rr�write)r�datarrr	�dataReceivedszProxy.dataReceived)�__name__�
__module__�__qualname__r
rr
rrrrrr	r
s
rc@seZdZdd�ZdS)�ProxyClientcCs@|j�|�|j�|jjd�|jj�|jd�|jj��dS)NT)rr
rZregisterProducerZresumeProducing)rrrr	�connectionMade$szProxyClient.connectionMadeN)rrrrrrrr	r#src@s(eZdZeZdd�Zdd�Zdd�ZdS)�ProxyClientFactorycCs
||_dSr)�server)rrrrr	�	setServer7szProxyClientFactory.setServercOs$tjj|f|�|�}|�|j�|Sr)r�
ClientFactory�
buildProtocolr
r)r�args�kwZprotrrr	r;sz ProxyClientFactory.buildProtocolcCs|jj��dSr)rrr)rZ	connectorrrrr	�clientConnectionFailedAsz)ProxyClientFactory.clientConnectionFailedN)rrrrrrrr rrrr	r3src@seZdZeZdZdd�ZdS)�ProxyServerNcCsT|j��|��}|�|�|jdkr8ddlm}||_|j�|jj|jj	|�dS)Nr)�reactor)
rZpauseProducing�clientProtocolFactoryrr"�twisted.internetZ
connectTCP�factory�host�port)rZclientr"rrr	rKs


zProxyServer.connectionMade)rrrrr#r"rrrrr	r!Fsr!c@seZdZdZeZdd�ZdS)�ProxyFactoryz%
    Factory for port forwarder.
    cCs||_||_dSr)r&r')rr&r'rrr	�__init__aszProxyFactory.__init__N)rrr�__doc__r!rr)rrrr	r(Zsr(N)
r*r$rZtwisted.pythonrZProtocolrrrrr!ZFactoryr(rrrr	�<module>s