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__/handshake.cpython-311.pyc
�

�=Xcd���ddlmZddlZddlZddlmZddlmZmZddl	m
Z
mZmZddl
mZmZddlmZmZdd	lmZmZgd
�Zdd�Zdd�Zdd�Zdd�ZdS)�)�annotationsN)�List�)�Headers�MultipleValuesError)�
InvalidHeader�InvalidHeaderValue�InvalidUpgrade)�parse_connection�
parse_upgrade)�ConnectionOption�UpgradeProtocol)�
accept_key�generate_key)�
build_request�
check_request�build_response�check_response�headersr�return�strc�J�t��}d|d<d|d<||d<d|d<|S)z�
    Build a handshake request to send to the server.

    Update request headers passed in argument.

    Args:
        headers: handshake request headers.

    Returns:
        str: ``key`` that must be passed to :func:`check_response`.

    �	websocket�Upgrade�
Connection�Sec-WebSocket-Key�13�Sec-WebSocket-Version)r�r�keys  �=/usr/lib/python3/dist-packages/websockets/legacy/handshake.pyrrs<���.�.�C�$�G�I��%�G�L��#&�G�� �'+�G�#�$��J�c��td�|�d��D��g��}td�|D����s#tdd�|�����td�|�d��D��g��}t|��dkr|d���d	ks#tdd�|�����	|d
}n@#t$r}td
��|�d}~wt$r}td
d��|�d}~wwxYw	tj|���d
���}n(#tj$r}td
|��|�d}~wwxYwt|��dkrtd
|���	|d}n@#t$r}td��|�d}~wt$r}tdd��|�d}~wwxYw|dkrtd|���|S)ad
    Check a handshake request received from the client.

    This function doesn't verify that the request is an HTTP/1.1 or higher GET
    request and doesn't perform ``Host`` and ``Origin`` checks. These controls
    are usually performed earlier in the HTTP request handling code. They're
    the responsibility of the caller.

    Args:
        headers: handshake request headers.

    Returns:
        str: ``key`` that must be passed to :func:`build_response`.

    Raises:
        InvalidHandshake: if the handshake request is invalid;
            then the server must return 400 Bad Request error.

    c�,�g|]}t|����S��r��.0�values  r!�
<listcomp>z!check_request.<locals>.<listcomp>;�!��L�L�L�U�	�%�	 �	 �L�L�Lr"rc3�FK�|]}|���dkV��dS��upgradeN��lowerr's  r!�	<genexpr>z check_request.<locals>.<genexpr>>�/����B�B�e�u�{�{�}�}�	�)�B�B�B�B�B�Br"�, c�,�g|]}t|����Sr%�rr's  r!r*z!check_request.<locals>.<listcomp>B� ��F�F�F�%��u�	�	�F�F�Fr"r�rrrNz,more than one Sec-WebSocket-Key header foundT)�validate�rz0more than one Sec-WebSocket-Version header foundr)�sum�get_all�anyr
�join�lenr0�KeyErrorrr�base64�	b64decode�encode�binascii�Errorr	)r�
connectionr.�s_w_key�exc�raw_key�s_w_versions       r!rr&sq��(*-�L�L�g�o�o�l�.K�.K�L�L�L�b�*�*�J��B�B�z�B�B�B�B�B�B��\�4�9�9�Z�+@�+@�A�A�A�%(�F�F�7�?�?�9�+E�+E�F�F�F��&�&�G�
��L�L�A���'�!�*�"2�"2�"4�"4��"C�"C��Y��	�	�'�(:�(:�;�;�;���-�.�����:�:�:��/�0�0�c�9�����������!O�
�
��	���������
H��"�7�>�>�#3�#3�d�C�C�C�����>�H�H�H� �!4�g�>�>�C�G�����H����
�7�|�|�r��� �!4�g�>�>�>���5�6�����>�>�>��3�4�4�#�=����������#�%W�
�
��	���������
�d��� �!8�+�F�F�F��Ns`�,C5�5
D2�?D�
D2�D-�-D2�6(E�F�.E?�?F�+F4�4
G1�>G�
G1�G,�,G1r �Nonec�>�d|d<d|d<t|��|d<dS)z�
    Build a handshake response to send to the client.

    Update response headers passed in argument.

    Args:
        headers: handshake response headers.
        key: returned by :func:`check_request`.

    rrr�Sec-WebSocket-AcceptN)�acceptrs  r!rrjs/��%�G�I��%�G�L��&,�S�k�k�G�"�#�#�#r"c��td�|�d��D��g��}td�|D����s#tdd�|�����td�|�d��D��g��}t|��dkr|d���d	ks#tdd
�|�����	|d}n@#t$r}td��|�d}~wt$r}tdd
��|�d}~wwxYw|t|��krtd|���dS)a�
    Check a handshake response received from the server.

    This function doesn't verify that the response is an HTTP/1.1 or higher
    response with a 101 status code. These controls are the responsibility of
    the caller.

    Args:
        headers: handshake response headers.
        key: returned by :func:`build_request`.

    Raises:
        InvalidHandshake: if the handshake response is invalid.

    c�,�g|]}t|����Sr%r&r's  r!r*z"check_response.<locals>.<listcomp>�r+r"rc3�FK�|]}|���dkV��dSr-r/r's  r!r1z!check_response.<locals>.<genexpr>�r2r"� c�,�g|]}t|����Sr%r5r's  r!r*z"check_response.<locals>.<listcomp>�r6r"rr7rrr3rLNz/more than one Sec-WebSocket-Accept header found)r:r;r<r
r=r>r0r?rrrMr	)rr rEr.�
s_w_acceptrGs      r!rrzs��� *-�L�L�g�o�o�l�.K�.K�L�L�L�b�*�*�J��B�B�z�B�B�B�B�B�A��\�3�8�8�J�+?�+?�@�@�@�%(�F�F�7�?�?�9�+E�+E�F�F�F��&�&�G�
��L�L�A���'�!�*�"2�"2�"4�"4��"C�"C��Y��	�	�'�(:�(:�;�;�;���3�4�
�
���=�=�=��2�3�3��<����������"�$U�
�
��	���������
�V�C�[�[� � � �!7��D�D�D�!� s$�,C5�5
D2�?D�
D2�D-�-D2)rrrr)rrr rrrJ)�
__future__rr@rC�typingr�datastructuresrr�
exceptionsrr	r
rrrr
r�utilsrrMr�__all__rrrrr%r"r!�<module>rZs,��"�"�"�"�"�"�
�
�
�
�����������9�9�9�9�9�9�9�9�J�J�J�J�J�J�J�J�J�J�5�5�5�5�5�5�5�5�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�Q�
P�
P������*A�A�A�A�H
2�
2�
2�
2� +E�+E�+E�+E�+E�+Er"

Youez - 2016 - github.com/yon3zu
LinuXploit