403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/websockets/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/websockets/__pycache__/http11.cpython-311.pyc
�

�=Xc1���ddlmZddlZddlZddlZddlmZmZmZddl	m
Z
mZdZdZ
dZdd
�Zejd��Zejd��ZejGd�d����ZejGd�d����Zdd�Zdd�ZdS)�)�annotationsN)�Callable�	Generator�Optional�)�datastructures�
exceptions�i i�value�bytes�return�strc�.�|�d���S)zG
    Decode a bytestring for interpolating into an error message.

    �backslashreplace)�errors)�decode)rs �3/usr/lib/python3/dist-packages/websockets/http11.py�drs��
�<�<�1�<�2�2�2�s[-!#$%&\'*+.^_`|~0-9a-zA-Z]+s[\x09\x20-\x7e\x80-\xff]*c�n�eZdZUdZded<ded<dZded<edd
���Zedd���Z	dd�Z
dS)�Requestz�
    WebSocket handshake request.

    Attributes:
        path: Request path, including optional query.
        headers: Request headers.
    r�path�datastructures.Headers�headersN�Optional[Exception]�
_exceptionr
c�D�tjdt��|jS)NzKRequest.exception is deprecated; use ServerConnection.handshake_exc instead��warnings�warn�DeprecationWarningr��selfs r�	exceptionzRequest.exceptionC�(���
�
9��	
�	
�	
�
��r�	read_line�-Callable[[int], Generator[None, None, bytes]]�Generator[None, None, Request]c#�ZK�	t|��Ed{V��}n"#t$r}td��|�d}~wwxYw	|�dd��\}}}n.#t$r!tdt	|������d�wxYw|dkrtdt	|�������|dkrtd	t	|�������|�d
d��}t
|��Ed{V��}d|vrtd
���d|vrtd���|||��S)a�
        Parse a WebSocket handshake request.

        This is a generator-based coroutine.

        The request path isn't URL-decoded or validated in any way.

        The request path and headers are expected to contain only ASCII
        characters. Other characters are represented with surrogate escapes.

        :meth:`parse` doesn't attempt to read the request body because
        WebSocket handshake requests don't have one. If the request contains a
        body, it may be read from the data stream after :meth:`parse` returns.

        Args:
            read_line: generator-based coroutine that reads a LF-terminated
                line or raises an exception if there isn't enough data

        Raises:
            EOFError: if the connection is closed without a full HTTP request.
            SecurityError: if the request exceeds a security limit.
            ValueError: if the request isn't well formatted.

        Nz1connection closed while reading HTTP request line� �zinvalid HTTP request line: sGETzunsupported HTTP method: �HTTP/1.1�unsupported HTTP version: �ascii�surrogateescape�Transfer-Encoding�!transfer codings aren't supported�Content-Lengthzunsupported request body)�
parse_line�EOFError�split�
ValueErrorrr�
parse_headers�NotImplementedError)	�clsr&�request_line�exc�method�raw_path�versionrrs	         r�parsez
Request.parseLs�����F	Y�&0��&;�&;�;�;�;�;�;�;�L�L���	Y�	Y�	Y��N�O�O�UX�X�����	Y����	X�(4�(:�(:�4��(C�(C�%�F�H�g�g���	X�	X�	X��L�1�\�?�?�L�L�M�M�SW�W�	X�����V����D��6���D�D�E�E�E��k�!�!��F�!�G�*�*�F�F�G�G�G����w�(9�:�:��*�9�5�5�5�5�5�5�5�5���'�)�)�%�&I�J�J�J��w�&�&��7�8�8�8��s�4��!�!�!s��
9�4�9�A�+Brc�x�d|j�d����}||j���z
}|S)z;
        Serialize a WebSocket handshake request.

        zGET z HTTP/1.1
)r�encoder�	serialize)r#�requests  rrBzRequest.serialize�s?��2���1�1�1�8�8�:�:���4�<�)�)�+�+�+���r�r
r)r&r'r
r(�r
r)�__name__�
__module__�__qualname__�__doc__�__annotations__r�propertyr$�classmethodr?rB�rrrr3s�����������I�I�I�#�#�#�#�'+�J�*�*�*�*�
�����X���<"�<"�<"��[�<"�|	�	�	�	�	�	rrc��eZdZUdZded<ded<ded<dZd	ed
<dZded<edd���Ze	dd���Z
dd�ZdS)�Responsez�
    WebSocket handshake response.

    Attributes:
        status_code: Response code.
        reason_phrase: Response reason.
        headers: Response headers.
        body: Response body, if any.

    �int�status_coder�
reason_phraserrNzOptional[bytes]�bodyrrr
c�D�tjdt��|jS)NzLResponse.exception is deprecated; use ClientConnection.handshake_exc insteadrr"s rr$zResponse.exception�r%rr&r'�
read_exact�read_to_eof�Generator[None, None, Response]c#�K�	t|��Ed{V��}n"#t$r}td��|�d}~wwxYw	|�dd��\}}}n.#t$r!tdt	|������d�wxYw|dkrtdt	|�������	t|��}	n.#t$r!tdt	|������d�wxYwd	|	cxkrd
ks!ntdt	|�������t�|��stdt	|�������|���}
t|��Ed{V��}d
|vrtd���d	|	cxkrdksn|	dks|	dkrd}n�	|d}
t|
��}n#t$rd}YnwxYw|�C	|t��Ed{V��}n_#t$rtjdt�d����wxYw|tkrtjd|�d����||��Ed{V��}||	|
||��S)a�
        Parse a WebSocket handshake response.

        This is a generator-based coroutine.

        The reason phrase and headers are expected to contain only ASCII
        characters. Other characters are represented with surrogate escapes.

        Args:
            read_line: generator-based coroutine that reads a LF-terminated
                line or raises an exception if there isn't enough data.
            read_exact: generator-based coroutine that reads the requested
                bytes or raises an exception if there isn't enough data.
            read_to_eof: generator-based coroutine that reads until the end
                of the stream.

        Raises:
            EOFError: if the connection is closed without a full HTTP response.
            SecurityError: if the response exceeds a security limit.
            LookupError: if the response isn't well formatted.
            ValueError: if the response isn't well formatted.

        Nz0connection closed while reading HTTP status liner*r+zinvalid HTTP status line: r,r-zinvalid HTTP status code: �di�zunsupported HTTP status code: zinvalid HTTP reason phrase: r0r1����i0r2zbody too large: over z byteszbody too large: )r3r4r5r6rrP�	_value_re�	fullmatchrr7r8�KeyError�MAX_BODY�RuntimeErrorr	�
SecurityError)r9r&rUrV�status_liner;r>�raw_status_code�
raw_reasonrQ�reasonrrS�raw_content_length�content_lengths               rr?zResponse.parse�se����@	X�%/�	�%:�%:�:�:�:�:�:�:�K�K���	X�	X�	X��M�N�N�TW�W�����	X����	V�3>�3D�3D�T�1�3M�3M�0�G�_�j�j���	V�	V�	V��J�!�K�.�.�J�J�K�K�QU�U�	V�����k�!�!��F�!�G�*�*�F�F�G�G�G�	��o�.�.�K�K���	�	�	��A�Q��-?�-?�A�A����
�	�����k�(�(�(�(�D�(�(�(�(��R�a��>P�>P�R�R�S�S�S��"�"�:�.�.�	M��K�A�j�M�M�K�K�L�L�L��"�"�$�$��*�9�5�5�5�5�5�5�5�5���'�)�)�%�&I�J�J�J��+�#�#�#�#��#�#�#�#�{�c�'9�'9�[�C�=O�=O��D�D�
9�&-�-=�%>�"�"%�%7�!8�!8�����
&�
&�
&�!%����
&����
�%��&1�k�(�&;�&;�;�;�;�;�;�;�D�D��#����$�2�@��@�@�@�������� �(�*�*� �.�=�~�=�=�=����#-�*�^�"<�"<�<�<�<�<�<�<���s�;����6�6�6sE��
9�4�9�A�+B�,B<�<+C'�,G�G�G�G0�0(Hrc��d|j�d|j�d����}||j���z
}|j�
||jz
}|S)z<
        Serialize a WebSocket handshake response.

        z	HTTP/1.1 � z
)rQrRrArrBrS)r#�responses  rrBzResponse.serializes`��K�t�/�J�J�$�2D�J�J�J�Q�Q�S�S���D�L�*�*�,�,�,���9� ���	�!�H��rrD)r&r'rUr'rVr'r
rWrE)rFrGrHrIrJrSrrKr$rLr?rBrMrrrOrO�s��������	�	���������#�#�#�#� �D� � � � �&*�J�*�*�*�*�
�����X���\7�\7�\7��[�\7�|�����rrOr&r'�-Generator[None, None, datastructures.Headers]c#�K�tj��}ttdz��D�]E}	t	|��Ed{V��}n"#t
$r}td��|�d}~wwxYw|dkr�n	|�dd��\}}n.#t$r!tdt|������d�wxYwt�
|��stdt|�������|�d��}t�
|��std	t|�������|�
d
��}|�
d
d��}|||<��Gtjd���|S)
a�
    Parse HTTP headers.

    Non-ASCII characters are represented with surrogate escapes.

    Args:
        read_line: generator-based coroutine that reads a LF-terminated line
            or raises an exception if there isn't enough data.

    Raises:
        EOFError: if the connection is closed without complete headers.
        SecurityError: if the request exceeds a security limit.
        ValueError: if the request isn't well formatted.

    rNz,connection closed while reading HTTP headersr�:zinvalid HTTP header line: zinvalid HTTP header name: s 	zinvalid HTTP header value: r.r/ztoo many HTTP headers)r�Headers�range�MAX_HEADERSr3r4r5r6r�	_token_rer]�stripr\rr	ra)	r&r�_�liner;�raw_name�	raw_value�namers	         rr7r7!s�����,�$�&�&�G�
�;��?�
#�
#�@�@��	T�(��3�3�3�3�3�3�3�3�D�D���	T�	T�	T��I�J�J�PS�S�����	T�����3�;�;��E�	O�"&�*�*�T�1�"5�"5��H�i�i���	O�	O�	O��C�!�D�'�'�C�C�D�D�$�N�	O�����"�"�8�,�,�	I��G�!�H�+�+�G�G�H�H�H��O�O�F�+�+�	��"�"�9�-�-�	K��I�1�Y�<�<�I�I�J�J�J����w�'�'��� � ��*;�<�<�����
�
��&�'>�?�?�?��Ns#�A�
A&�A!�!A&�3B
�
+B8�Generator[None, None, bytes]c#��K�	|t��Ed{V��}n"#t$rtjd���wxYw|�d��std���|dd�S)ao
    Parse a single line.

    CRLF is stripped from the return value.

    Args:
        read_line: generator-based coroutine that reads a LF-terminated line
            or raises an exception if there isn't enough data.

    Raises:
        EOFError: if the connection is closed without a CRLF.
        SecurityError: if the response exceeds a security limit.

    Nz
line too longs
zline without CRLF���)�MAX_LINEr`r	ra�endswithr4)r&rts  rr3r3Ts�����"8�#�)�H�-�-�-�-�-�-�-�-�����8�8�8��&��7�7�7�8�����=�=��!�!�,��*�+�+�+�����9�s��:)rrr
r)r&r'r
rk)r&r'r
rx)�
__future__r�dataclasses�rer�typingrrr�rr	rpr{r_r�compilerqr\�	dataclassrrOr7r3rMrr�<module>r�sq��"�"�"�"�"�"�����	�	�	�	�����0�0�0�0�0�0�0�0�0�0�(�(�(�(�(�(�(�(�������3�3�3�3�
�B�J�7�8�8�	�
�B�J�4�5�5�	�
��`�`�`�`�`�`�`���`�F
��F�F�F�F�F�F�F���F�R0�0�0�0�f�����r

Youez - 2016 - github.com/yon3zu
LinuXploit