Server IP : 209.38.156.173 / Your IP : 216.73.216.128 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/protocols/haproxy/__pycache__/ |
Upload File : |
o �b] � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlm Z ddl mZ ddlm Z dd lmZ dd lmZ G dd� de j�ZG d d� de j�Zdejdefdd�ZdS )z@ Protocol wrapper that provides HAProxy PROXY protocol support. � )�Optional�Union)� interfaces)�_WrapperServerEndpoint)�policies� )�_info)�InvalidProxyHeader)�V1Parser)�V2Parserc s` e Zd ZdZdejdejf� fdd�Zde ddfd d �Z dejfdd�Zdejfd d�Z � ZS )�HAProxyProtocolWrappera A Protocol wrapper that provides HAProxy support. This protocol reads the PROXY stream header, v1 or v2, parses the provided connection data, and modifies the behavior of getPeer and getHost to return the data provided by the PROXY header. �factory�wrappedProtocolc s t � �||� d | _d | _d S �N)�super�__init__� _proxyInfo�_parser)�selfr r �� __class__� �D/usr/lib/python3/dist-packages/twisted/protocols/haproxy/_wrapper.pyr s zHAProxyProtocolWrapper.__init__�data�returnNc C s� | j d ur| j�|�S | j}|d u rPt|�dkr4|d d� tjkr4t|dd� �d@ dkr4t� | _}nt|�dkrJ|d d� tj krJt� | _}n| � � d S z|�|�\| _ }|rd| j�|� W d S W d S tyt | � � Y d S w )N� � � �� � � � ) r r �dataReceivedr �lenr �PREFIX�ordr �PROXYSTR�loseConnection�feedr )r r �parser� remainingr r r r"