403Webshell
Server IP : 172.67.201.108  /  Your IP : 216.73.217.73
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5
System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/awscrt/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/awscrt/__pycache__/http.cpython-39.opt-1.pyc
a

ů�i8��@s�dZddlZddlmZddlmZddlZddlmZm	Z	m
Z
mZddlm
Z
ddlmZmZmZmZmZmZmZmZGdd	�d	e
�ZGd
d�de
�ZGdd
�d
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gd d!�d!e"�Z#Gd"d#�d#e�Z$Gd$d%�d%e
�Z%Gd&d'�d'e
�Z&Gd(d)�d)�Z'Gd*d+�d+�Z(dS),zA
HTTP

All network operations in `awscrt.http` are asynchronous.
�N)�Future)�NativeResource)�ClientBootstrap�InputStream�TlsConnectionOptions�
SocketOptions)�IntEnum)�List�Tuple�Dict�Optional�Union�Iterator�Callable�Anyc@s eZdZdZdZdZdZdZdS)�HttpVersionz!HTTP protocol version enumerationr���N)�__name__�
__module__�__qualname__�__doc__ZUnknownZHttp1_0ZHttp1_1�Http2�rr�1/usr/lib64/python3.9/site-packages/awscrt/http.pyrs
rc@s(eZdZdZdZdZdZdZdZdZ	dS)	�Http2SettingIDz+HTTP/2 Predefined settings(RFC-9113 6.5.2).rrr���N)
rrrr�HEADER_TABLE_SIZE�ENABLE_PUSH�MAX_CONCURRENT_STREAMS�INITIAL_WINDOW_SIZE�MAX_FRAME_SIZE�MAX_HEADER_LIST_SIZErrrrrsrc@s�eZdZUdZejdejdejdejdej	dej
diZeee
eeffed<eedd�d	d
�Zeedd�dd�Zed
�dd�ZdS)�Http2Settinga�HTTP/2 Setting.
    Settings are very complicated in HTTP/2.
    Each end has its own settings, and the local settings cannot be applied
    until the remote end acknowledges it.
    Each end can change its settings at any time, while the order of the settings
    changed may also result in different behavior.

    Each setting has its boundary and initial values defined in RFC-9113 6.5.2:
    Initial values are listed below, while the range can be found in VALID_RANGES:
    HEADER_TABLE_SIZE: 4096
    ENABLE_PUSH: 1
    MAX_CONCURRENT_STREAMS: 2^32-1
    INITIAL_WINDOW_SIZE: 2^16-1
    MAX_FRAME_SIZE: 2^14
    MAX_HEADER_LIST_SIZE: 2^32-1

    Args:
        id (Http2SettingID): Setting ID.
        value (int): Setting value.
    )rl��)rr)ri���)i@i����VALID_RANGESN)�id�value�returncCs||_|�||�||_dS�N)r(�_validate_setting_valuer))�selfr(r)rrr�__init__CszHttp2Setting.__init__cCsL|j|\}}||kr"|ksHn|j}t|�d|�d|�d|����dS)zTValidate that setting value is within its allowed range according to RFC-9113 6.5.2.z must be between z and z, got N)r'�name�
ValueError)r-r(r)Z	min_valueZ	max_valueZsetting_namerrrr,Lsz$Http2Setting._validate_setting_value�r*cCs |jjd|jj�d|j�d�S)N�(�=�))�	__class__rr(r/r)�r-rrr�__str__SszHttp2Setting.__str__)rrrrrr r!r"r#r$r%r'rr
�int�__annotations__r.r,�strr7rrrrr&%s
�		r&cs\eZdZdZdZdd��fdd�Zedd�dd	��Zeed�d
d��Z	e
d�dd
�Z�ZS)�HttpConnectionBasez!Base for HTTP connection classes.)�_shutdown_future�_versionNr1cst���t�|_dSr+)�superr.rr<r6�r5rrr.\s
zHttpConnectionBase.__init__�concurrent.futures.FuturecCs|jS)a&
        concurrent.futures.Future: Completes when this connection has finished shutting down.
        Future will contain a result of None, or an exception indicating why shutdown occurred.
        Note that the connection may have been garbage-collected before this future completes.
        )r<r6rrr�shutdown_future`sz"HttpConnectionBase.shutdown_futurecCs|jS)z-HttpVersion: Protocol used by this connection�r=r6rrr�versioniszHttpConnectionBase.versioncCst�|j�S)z�
        Returns:
            bool: True if this connection is open and usable, False otherwise.
            Check :attr:`shutdown_future` to know when the connection is completely
            finished shutting down.
        )�_awscrtZhttp_connection_is_open�_bindingr6rrr�is_opennszHttpConnectionBase.is_open)
rrrr�	__slots__r.�propertyrArrC�boolrF�
__classcell__rrr?rr;Wsr;c@s�eZdZdZedeeeeee	ee
edeeeee
eeee
gdfdd�
dd��Zeed	�d
d��Zeed	�dd
��ZdS)�HttpClientConnectionBase��
_host_name�_portNF�HttpProxyOptionsr@)
�	host_name�port�	bootstrap�socket_options�tls_connection_options�
proxy_options�expected_version�initial_settings�on_remote_settings_changedr*c

Cs�t�}
zL|st�}|st��}t|||||
|||	d�}t�|||||||||�	Wn.ty�}z|
�|�WYd}~n
d}~00|
S)zP
        Initialize the generic part of the HttpClientConnection class.
        )rRrT�connect_futurerVrX�asyncio_connectionN)	rrrZget_or_create_static_default�_HttpClientConnectionCorerDZhttp_client_connection_new�	Exception�
set_exception)
rPrQrRrSrTrUrVrWrXrZ�futureZconnection_core�errr�_generic_new{s<�
� z%HttpClientConnectionBase._generic_newr1cCs|jS)zRemote hostname)rMr6rrrrP�sz"HttpClientConnectionBase.host_namecCs|jS)zRemote port)rNr6rrrrQ�szHttpClientConnectionBase.port)NNNNNNNF)rrrrG�staticmethodr:r8rrrrrr	r&rr`rHrPrQrrrrrKxs4�
�8rKc
@sxeZdZdZdZedeeee	ee
eeeddd�dd��Zdd	ee
d
ee
d
dd�d
d�Zdd�dd�ZdS)�HttpClientConnectionzo
    An HTTP client connection.

    Use :meth:`HttpClientConnection.new()` to establish a new connection.
    rLNrOr@)rPrQrRrSrTrUr*cCs|�||||||�S)aY
        Asynchronously establish a new HttpClientConnection.

        Args:
            host_name (str): Connect to host.

            port (int): Connect to port.

            bootstrap (Optional [ClientBootstrap]): Client bootstrap to use when initiating socket connection.
                If None is provided, the default singleton is used.

            socket_options (Optional[SocketOptions]): Optional socket options.
                If None is provided, then default options are used.

            tls_connection_options (Optional[TlsConnectionOptions]): Optional TLS
                connection options. If None is provided, then the connection will
                be attempted over plain-text.

            proxy_options (Optional[HttpProxyOptions]): Optional proxy options.
                If None is provided then a proxy is not used.

        Returns:
            concurrent.futures.Future: A Future which completes when connection succeeds or fails.
            If successful, the Future will contain a new :class:`HttpClientConnection`.
            Otherwise, it will contain an exception.
        )r`)�clsrPrQrRrSrTrUrrr�new�s"�zHttpClientConnection.new�HttpRequest�.N�HttpClientStream)�request�on_response�on_bodyr*cCst||||�S)anCreate :class:`HttpClientStream` to carry out the request/response exchange.

        NOTE: The HTTP stream sends no data until :meth:`HttpClientStream.activate()`
        is called. Call activate() when you're ready for callbacks and events to fire.

        Args:
            request (HttpRequest): Definition for outgoing request.

            on_response: Optional callback invoked once main response headers are received.
                The function should take the following arguments and return nothing:

                    *   `http_stream` (:class:`HttpClientStream`): HTTP stream carrying
                        out this request/response exchange.

                    *   `status_code` (int): Response status code.

                    *   `headers` (List[Tuple[str, str]]): Response headers as a
                        list of (name,value) pairs.

                    *   `**kwargs` (dict): Forward compatibility kwargs.

                An exception raise by this function will cause the HTTP stream to end in error.
                This callback is always invoked on the connection's event-loop thread.

            on_body: Optional callback invoked 0+ times as response body data is received.
                The function should take the following arguments and return nothing:

                    *   `http_stream` (:class:`HttpClientStream`): HTTP stream carrying
                        out this request/response exchange.

                    *   `chunk` (buffer): Response body data (not necessarily
                        a whole "chunk" of chunked encoding).

                    *   `**kwargs` (dict): Forward-compatibility kwargs.

                An exception raise by this function will cause the HTTP stream to end in error.
                This callback is always invoked on the connection's event-loop thread.

        Returns:
            HttpClientStream:
        )rg)r-rhrirjrrrrh�s-zHttpClientConnection.requestr1cCst�|j�|jS�a#Close the connection.

        Shutdown is asynchronous. This call has no effect if the connection is already
        closing.

        Returns:
            concurrent.futures.Future: This connection's :attr:`shutdown_future`,
            which completes when shutdown has finished.
        �rDZhttp_connection_closerErAr6rrr�close s
zHttpClientConnection.close)NNNN)NN)rrrrrG�classmethodr:r8rrrrrdrrhrmrrrrrb�s.��+�
�/rbc
@s�eZdZedeeeeeeee	edee
eeee
egdfdd�	dd��Z
ddeed	eed	ed
d�dd
�Zdd�dd�ZdS)�Http2ClientConnectionNrOr@)	rPrQrRrSrTrUrWrXr*c		Cs|�||||||tj||�	S)a�
        Asynchronously establish an HTTP/2 client connection.
        Notes: to set up the connection, the server must support HTTP/2 and TlsConnectionOptions

        This class extends HttpClientConnection with HTTP/2 specific functionality.

        HTTP/2 specific args:
            initial_settings (List[Http2Setting]): The initial settings to change for the connection.

            on_remote_settings_changed: Optional callback invoked once the remote peer changes its settings.
                And the settings are acknowledged by the local connection.
                The function should take the following arguments and return nothing:

                    *   `settings` (List[Http2Setting]): List of settings that were changed.
        )r`rr)	rcrPrQrRrSrTrUrWrXrrrrd0s�zHttp2ClientConnection.newFrerf�Http2ClientStream)rhrirj�manual_writer*cCst|||||�S)a(Create `Http2ClientStream` to carry out the request/response exchange.

        NOTE: The HTTP stream sends no data until `Http2ClientStream.activate()`
        is called. Call activate() when you're ready for callbacks and events to fire.

        Args:
            request (HttpRequest): Definition for outgoing request.

            on_response: Optional callback invoked once main response headers are received.
                The function should take the following arguments and return nothing:

                    *   `http_stream` (`Http2ClientStream`): HTTP/2 stream carrying
                        out this request/response exchange.

                    *   `status_code` (int): Response status code.

                    *   `headers` (List[Tuple[str, str]]): Response headers as a
                        list of (name,value) pairs.

                    *   `**kwargs` (dict): Forward compatibility kwargs.

            on_body: Optional callback invoked 0+ times as response body data is received.
                The function should take the following arguments and return nothing:

                    *   `http_stream` (`Http2ClientStream`): HTTP/2 stream carrying
                        out this request/response exchange.

                    *   `chunk` (buffer): Response body data (not necessarily
                        a whole "chunk" of chunked encoding).

                    *   `**kwargs` (dict): Forward-compatibility kwargs.

            manual_write (bool): If True, enables manual data writing on the stream.
                This allows calling `write_data()` to stream the request body in chunks.
                Note: In the asyncio version, this is replaced by the async_body parameter.

        Returns:
            Http2ClientStream: Stream for the HTTP/2 request/response exchange.
        )rp)r-rhrirjrqrrrrhUs,zHttp2ClientConnection.requestr1cCst�|j�|jSrkrlr6rrrrm�s
zHttp2ClientConnection.close)NNNNNN)NNF)rrrrnr:r8rrrrr	r&rrdrIrhrmrrrrro.s<�
��&�

�.rocsjeZdZdZdZdeeddd��fdd�
Zee	d�d	d
��Z
edd�dd
��Zedd�dd�Z
�ZS)�HttpStreamBasez�Base for HTTP stream classes.

    Attributes:
        connection: The HTTP connection this stream belongs to.
        completion_future: Future that completes when the operation finishes.
    )�_connection�_completion_future�_on_body_cbNrf)rjr*cs"t���||_t�|_||_dSr+)r>r.rsrrtru)r-�
connectionrjr?rrr.�s
zHttpStreamBase.__init__r1cCs|jSr+)rsr6rrrrv�szHttpStreamBase.connectionr@cCs|jSr+)rtr6rrr�completion_future�sz HttpStreamBase.completion_future)�chunkr*cCs|jr|j||d�dS)N)�http_streamrx)ru)r-rxrrr�_on_body�szHttpStreamBase._on_body)N)rrrrrGrrr.rHr;rvrw�bytesrzrJrrr?rrr�srrcs�eZdZdZdZdedeedeededd��fdd	�
Z	e
ed
�dd��Ze
ee
d
�d
d��Ze
eeeefdd�dd�Ze
dd�dd�Z�ZS)�HttpClientStreamBasez�Base for HTTP client stream classes.

    Attributes:
        connection: This stream's connection.

        completion_future: Future that completes when
            the request/response exchange is finished.
    )�_response_status_code�_on_response_cbru�_requestr=NFrerf)rvrhrirj�http2_manual_writer*cs>t��||�||_d|_||_|j|_t�||||�|_	dSr+)
r>r.r~r}rrCr=rDZhttp_client_stream_newrE)r-rvrhrirjr�r?rr�_init_common�sz!HttpClientStreamBase._init_commonr1cCs|jS)z)HttpVersion: Protocol used by this streamrBr6rrrrC�szHttpClientStreamBase.versioncCs|jS)zNint: The response status code.

        This is None until a response arrives.)r}r6rrr�response_status_code�sz)HttpClientStreamBase.response_status_code)�status_code�name_value_pairsr*cCs ||_|jr|j|||d�dS)N)ryr��headers)r}r~)r-r�r�rrr�_on_response�sz!HttpClientStreamBase._on_response��
error_coder*cCs6d|_|dkr|j�|j�n|j�tj�|��dS)Nr)rrt�
set_resultr}r]�awscrt�
exceptions�	from_code�r-r�rrr�_on_complete�sz!HttpClientStreamBase._on_complete)NNF)rrrrrGrKrrrIr�rHrrCr8r�r	r
r:r�r�rJrrr?rr|�s$	�

�r|c@sFeZdZdZdedeedeeddd�dd�Zdd�d	d
�ZdS)rga�HTTP stream that sends a request and receives a response.

    Create an HttpClientStream with :meth:`HttpClientConnection.request()`.

    NOTE: The HTTP stream sends no data until :meth:`HttpClientStream.activate()`
    is called. Call activate() when you're ready for callbacks and events to fire.

    Attributes:
        connection (HttpClientConnection): This stream's connection.

        completion_future (concurrent.futures.Future): Future that will contain
            the response status code (int) when the request/response exchange
            completes. If the exchange fails to complete, the Future will
            contain an exception indicating why it failed.
    Nrerf)rvrhrirjr*cCs|�||||�dSr+�r�)r-rvrhrirjrrrr.�szHttpClientStream.__init__r1cCst�|�dS�z�Begin sending the request.

        The HTTP stream does nothing until this is called. Call activate() when you
        are ready for its callbacks and events to fire.
        N�rDZhttp_client_stream_activater6rrr�activateszHttpClientStream.activate)NN)	rrrrrbrrr.r�rrrrrg�s�
�rgc@s`eZdZdedeedeededd�dd�Zdd�d	d
�Zde	e
efedd�d
d�ZdS)rpNFrerf)rvrhrirjrqr*cCs|�|||||�dSr+r�)r-rvrhrirjrqrrrr.szHttp2ClientStream.__init__r1cCst�|�dSr�r�r6rrrr�szHttp2ClientStream.activater@)�data_stream�
end_streamr*cs<t��tj|dd�}tdd��fdd�}t�||||��S)anWrite a chunk of data to the request body stream.

        This method is only available when the stream was created with
        manual_write=True. This allows incremental writing of request data.

        Note: In the asyncio version, this is replaced by the request_body_generator parameter
        which accepts an async generator.

        Args:
            data_stream (Union[InputStream, Any]): Data to write. If not an InputStream,
                it will be wrapped in one. Can be None to send an empty chunk.

            end_stream (bool): True to indicate this is the last chunk and no more data
                will be sent. False if more chunks will follow.

        Returns:
            concurrent.futures.Future: Future that completes when the write operation
                is done. The future will contain None on success, or an exception on failure.
        T)Z
allow_noneNr�cs2���rdS|r$��tj�|��n
��d�dSr+)Z	cancelledr]r�r�r�r�)r��r^rr�on_write_complete5s
z7Http2ClientStream.write_data.<locals>.on_write_complete)rr�wrapr8rDZhttp2_client_stream_write_data)r-r�r��body_streamr�rr�r�
write_datas
	zHttp2ClientStream.write_data)NNF)F)
rrrrbrrrIr.r�r
rrr�rrrrrps �

�
�
�rpcs�eZdZdZdZdedeeeefdd��fdd�
Z	e
dd�d	d
��Ze
eed�dd��Zej
eeefdd
�dd��Z�ZS)�HttpMessageBasez8
    Base for HttpRequest and HttpResponse classes.
    )�_headers�_body_streamN�HttpHeaders)�bindingr�r�r*cs*t���||_||_d|_|r&||_dSr+)r>r.rEr�r�r�)r-r�r�r�r?rrr.Hs
zHttpMessageBase.__init__r1cCs|jS)zHttpHeaders: Headers to send.)r�r6rrrr�TszHttpMessageBase.headerscCs|jSr+)r�r6rrrr�YszHttpMessageBase.body_stream)�streamr*cCs t�|�|_t�|j|j�dSr+)rr�r�rDZhttp_message_set_body_streamrE)r-r�rrrr�]s)N)rrrrrGrrr
rr.rHr�r��setterrJrrr?rr�Bs��r�cs�eZdZdZdZdeeedeeee	fdd��fdd	�
Z
ee	e	dd
��fdd��Ze
ed
�dd��Zejedd�dd��Ze
ed
�dd��Zejedd�dd��Z�ZS)rea
    Definition for an outgoing HTTP request.

    The request may be transformed (ex: signing the request) before its data is eventually sent.

    Args:
        method (str): HTTP request method (verb). Default value is "GET".
        path (str): HTTP path-and-query value. Default value is "/".
        headers (Optional[HttpHeaders]): Optional headers. If None specified,
            an empty :class:`HttpHeaders` is created.
        body_stream(Optional[Union[InputStream, io.IOBase]]): Optional body as binary stream.
    r�GET�/Nr�)�method�pathr�r�r*cs8|durt�}t�|�}t��|||�||_||_dSr+)r�rDZhttp_message_new_requestr>r.r�r�)r-r�r�r�r�r�r?rrr.ss
zHttpRequest.__init__)�request_binding�headers_bindingr*cs*|�|�}t�|�}t||��||�|S)zJConstruct HttpRequest and its HttpHeaders from pre-existing native objects)�__new__r��
_from_bindingr>r.)rcr�r�rhr�r?rr�_from_bindings�s

zHttpRequest._from_bindingsr1cCst�|j�S)z str: HTTP request method (verb).)rDZhttp_message_get_request_methodrEr6rrrr��szHttpRequest.method)r�r*cCst�|j|�dSr+)rDZhttp_message_set_request_methodrE)r-r�rrrr��scCst�|j�S)zstr: HTTP path-and-query value.)rDZhttp_message_get_request_pathrEr6rrrr��szHttpRequest.path)r�r*cCst�|j|�Sr+)rDZhttp_message_set_request_pathrE)r-r�rrrr��s)r�r�NN)rrrrrGr:rr
rrr.rnr�rHr�r�r�rJrrr?rrecs,
��
recseZdZdZdZd"eeeeefdd��fdd�
Z	e
edd��fdd	��Zeedd
�dd�Z
eeeefdd�d
d�Zeedd
�dd�Zeeed�dd�Zd#eeeeed�dd�Zedd�dd�Zeedd
�dd�Zdd�dd�Zeeeefd�dd�Zed�d d!�Z�ZS)$r�a\
    Collection of HTTP headers.

    A given header name may have multiple values.
    Header names are always treated in a case-insensitive manner.
    HttpHeaders can be iterated over as (name,value) pairs.

    Args:
        name_value_pairs (Optional[List[Tuple[str, str]]]): Construct from a
            collection of (name,value) pairs.
    rN)r�r*cs&t���t��|_|r"|�|�dSr+)r>r.rDZhttp_headers_newrE�	add_pairs�r-r�r?rrr.�s

zHttpHeaders.__init__)r�r*cs"|�|�}t||���||_|S)z+Construct from a pre-existing native object)r�r>r.rE)rcr�r�r?rrr��s
zHttpHeaders._from_binding)r/r)r*cCst�|j||�dS)zu
        Add a name-value pair.

        Args:
            name (str): Name.
            value (str): Value.
        N)rDZhttp_headers_addrE�r-r/r)rrr�add�s
zHttpHeaders.addcCst�|j|�dS)z�
        Add list of (name,value) pairs.

        Args:
            name_value_pairs (List[Tuple[str, str]]): List of (name,value) pairs.
        N)rDZhttp_headers_add_pairsrEr�rrrr��szHttpHeaders.add_pairscCst�|j||�dS)z�
        Set a name-value pair, any existing values for the name are removed.

        Args:
            name (str): Name.
            value (str): Value.
        N)rDZhttp_headers_setrEr�rrr�set�s
zHttpHeaders.set)r/r*ccsF|��}tt�|j��D](}t�|j|�\}}|��|kr|VqdS)z�
        Return an iterator over the values for this name.

        Args:
            name (str): Name.

        Returns:
            Iterator[str]: Iterator over values for this header name
        N)�lower�rangerD�http_headers_countrE�http_headers_get_index)r-r/�iZname_iZvalue_irrr�
get_values�s
zHttpHeaders.get_values)r/�defaultr*cCst�|j||�S)ag
        Get the first value for this name, ignoring any additional values.
        Returns `default` if no values exist.

        Args:
            name (str): Name.
            default (Optional[str]): If `name` not found, this value is returned.
                Defaults to None.
        Returns:
            Optional[str]: Header value or default
        )rDZhttp_headers_getrE)r-r/r�rrr�get�s
zHttpHeaders.getcCst�|j|�dS)z�
        Remove all values for this name.
        Raises a KeyError if name not found.

        Args:
            name (str): Header name.
        N)rDZhttp_headers_removerE)r-r/rrr�remove�s	zHttpHeaders.removecCst�|j||�dS)z�
        Remove a specific value for this name.
        Raises a ValueError if value not found.

        Args:
            name (str): Name.
            value (str): Value.
        N)rDZhttp_headers_remove_valuerEr�rrr�remove_value	szHttpHeaders.remove_valuer1cCst�|j�dS)z$
        Clear all headers.
        N)rDZhttp_headers_clearrEr6rrr�clearszHttpHeaders.clearccs*tt�|j��D]}t�|j|�VqdS)z6
        Iterate over all (name,value) pairs.
        N)r�rDr�rEr�)r-r�rrr�__iter__szHttpHeaders.__iter__cCs"|jjdtdd�|D��dS)Nr2cSsg|]}|�qSrr)�.0Zpairrrr�
<listcomp>$�z'HttpHeaders.__str__.<locals>.<listcomp>r4)r5rr:r6rrrr7#szHttpHeaders.__str__)N)N)rrrrrGrr	r
r:r.rnrr�r�r�r�rr�r�r�r�r�r�r7rJrrr?rr��s&	
r�c@seZdZdZdZdZdZdS)�HttpProxyConnectionTypez!Proxy connection type enumerationrrrN)rrrr�LegacyZ
ForwardingZ	Tunnelingrrrrr�'s
r�c@seZdZdZdZdZdS)�HttpProxyAuthenticationTypez&Proxy authentication type enumeration.rrN)rrrr�NothingZBasicrrrrr�<sr�c
@sHeZdZdZdejddejfee	e
eee
ee
eedd�dd�ZdS)rOaS
    Proxy options for HTTP clients.

    Args:
        host_name (str): Name of the proxy server to connect through.

        port (int): Port number of the proxy server to connect through.

        tls_connection_options (Optional[TlsConnectionOptions]): Optional
            `TlsConnectionOptions` for the Local to Proxy connection.
            Must be distinct from the `TlsConnectionOptions`
            provided to the HTTP connection.

        auth_type (HttpProxyAuthenticationType): Type of proxy authentication to use.
            Default is :const:`HttpProxyAuthenticationType.Nothing`.

        auth_username (Optional[str]): Username to use when `auth_type` is
            :const:`HttpProxyAuthenticationType.Basic`.

        auth_password (Optional[str]): Username to use when `auth_type` is
            :const:`HttpProxyAuthenticationType.Basic`.

        connection_type (Optional[HttpProxyConnectionType): Type of proxy connection to make.
            Default is :const:`HttpProxyConnectionType.Legacy`.


    Attributes:
        host_name (str): Name of the proxy server to connect through.

        port (int): Port number of the proxy server to connect through.

        tls_connection_options (Optional[TlsConnectionOptions]): Optional
            `TlsConnectionOptions` for the Local to Proxy connection.
            Must be distinct from the `TlsConnectionOptions`
            provided to the HTTP connection.

        auth_type (HttpProxyAuthenticationType): Type of proxy authentication to use.

        auth_username (Optional[str]): Username to use when `auth_type` is
            :const:`HttpProxyAuthenticationType.Basic`.

        auth_password (Optional[str]): Username to use when `auth_type` is
            :const:`HttpProxyAuthenticationType.Basic`.

        connection_type (HttpProxyConnectionType): Type of proxy connection to make.

    N)rPrQrT�	auth_type�
auth_username�
auth_password�connection_typer*cCs.||_||_||_||_||_||_||_dSr+)rPrQrTr�r�r�r�)r-rPrQrTr�r�r�r�rrrr.vszHttpProxyOptions.__init__)
rrrrr�r�r�r�r:r8rrr.rrrrrOEs3��rOc@s�eZdZdZdeeeeeeee	ee
eeee
gdfdd�dd�Zeee
dd�dd	�Zedd
�dd�Zeeeefdd
�dd�ZdS)r[zr
    Private class to keep all the related Python object alive until C land clean up for HttpClientConnection
    NF)rPrQrRrTrYrVrXr*c		Cs:d|_||_||_||_||_||_||_||_||_dSr+)	r<rMrN�
_bootstrapZ_tls_connection_options�_connect_future�_expected_version�%_on_remote_settings_changed_from_user�_asyncio_connection)	r-rPrQrRrTrYrVrXrZrrrr.�s
z"_HttpClientConnectionCore.__init__)r�r��http_versionr*cCs�|jdurdS|dkr.|j�tj�|��dS|jrV|j|krV|j�tj�d��dS|jr�ddlm}m	}|t
jkr~|�}q�|�}n|t
jkr�t�}nt
�}|j|_|j|_||_t
|�|_|j|_|j�|�d|_dS)Nri)�AIOHttpClientConnection�AIOHttp2ClientConnection)r�r]r�r�r�r�r�Zawscrt.aio.httpr�r�rrrorbrMrNrEr=rAr<r�)r-r�r�r�r�r�rvrrr�_on_connection_setup�s.



z._HttpClientConnectionCore._on_connection_setupr�cCs8|jdurdS|r(|j�tj�|��n|j�d�dSr+)r<r]r�r�r�r�r�rrr�_on_shutdown�s

z&_HttpClientConnectionCore._on_shutdown)�native_settingsr*cCs"|jrdd�|D�}|�|�dS)NcSsg|]\}}tt|�|��qSr)r&r)r�r(r)rrrr��r�zI_HttpClientConnectionCore._on_remote_settings_changed.<locals>.<listcomp>)r�)r-r�Zsettingsrrr�_on_remote_settings_changed�sz5_HttpClientConnectionCore._on_remote_settings_changed)NNNNNF)rrrrr:r8rrrrrrr	r&r.rr�r�r
r�rrrrr[�s(��"	r[))rrD�concurrent.futuresrr�rZawscrt.exceptionsZ	awscrt.iorrrr�enumr�typingr	r
rrr
rrrrrr&r;rKrbrorrr|rgrpr�rer�r�r�rOr[rrrr�<module>s4	(
2!Goc=!7!=	B

Youez - 2016 - github.com/yon3zu
LinuXploit