HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/zmq/ssh/__pycache__/forward.cpython-310.pyc
o

;j��@s\dZddlZddlZddlZe�d�ZGdd�dej�ZGdd�dej�Z	dd	�Z
d	gZdS)
a
Sample script showing how to do local port forwarding over paramiko.

This script connects to the requested SSH server and sets up local port
forwarding (the openssh -L option) from a local port through a tunneled
connection to a destination reachable from the SSH server machine.
�NZsshc@seZdZdZdZdS)�
ForwardServerTN)�__name__�
__module__�__qualname__Zdaemon_threadsZallow_reuse_address�rr�C/opt/saltstack/salt/lib/python3.10/site-packages/zmq/ssh/forward.pyr"src@seZdZdd�ZdS)�Handlerc
CsBz|j�d|j|jf|j���}Wnty.}zt�d|j|j|�WYd}~dSd}~ww|dur>t�d|j|j�dSt�d|j���d|���d|j|jf���	t	�	|j|ggg�\}}}|j|vrz|j�
d�}t|�dkrun|�|�||vr�|�
d�}t|�dkr�n|j�|�qV|�
�|j�
�t�d	�dS)
Nzdirect-tcpipz$Incoming request to %s:%d failed: %rz9Incoming request to %s:%d was rejected by the SSH server.zConnected!  Tunnel open z -> TirzTunnel closed )�
ssh_transportZopen_channel�
chain_host�
chain_port�request�getpeername�	Exception�logger�debug�select�recv�len�send�close)�selfZchan�e�r�w�x�datarrr�handle(sT
�����&�


�
zHandler.handleN)rrrrrrrrr'srcs.G���fdd�dt�}td|f|���dS)NcseZdZ�Z�Z�ZdS)z!forward_tunnel.<locals>.SubHanderN)rrrr
rr	r��remote_host�remote_port�	transportrr�	SubHanderWsr!z	127.0.0.1)rrZ
serve_forever)Z
local_portrrr r!rrr�forward_tunnelSsr")�__doc__�loggingrZsocketserver�	getLoggerrZThreadingTCPServerrZBaseRequestHandlerrr"�__all__rrrr�<module>s
,