File: //usr/lib/python3/dist-packages/websocket/__pycache__/_wsdump.cpython-310.pyc
o
mîa� �
@ s2 d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlZzddlZW n e
y; Y nw dd� ZejjejjfZe� ZG dd� dej�Zdd � ZG d
d� d�ZG dd
� d
eej�ZG dd� de�Zdd� Zedkr�ze� W dS ey� Z zee� W Y dZ[dS dZ[ww dS )a`
wsdump.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
� N)�urlparsec C s t tjdd�} | sdS | �� S )N�encoding� �utf-8)�getattr�sys�stdin�lower)r � r
�3/usr/lib/python3/dist-packages/websocket/_wsdump.py�get_encoding( s r c @ s e Zd Zddd�ZdS )�VActionNc C sL |d u rd}zt |�}W n ty |�d�d }Y nw t|| j|� d S )N�1�v� )�int�
ValueError�count�setattr�dest)�self�parser�args�values�
option_stringr
r
r �__call__6 s �zVAction.__call__)N)�__name__�
__module__�__qualname__r r
r
r
r r
4 s r
c C s� t jdd�} | jdddd� | jddd d
� | jddd
dtddd� | jddddd� | jddddd� | jddddd� | jdd d!d
� | jd"d
td#d$� | jd%d&d'd
� | jd(dd)d� | jd*d+d
� | �� S ),NzWebSocket Simple Dump Tool)�description�url�ws_urlz+websocket url. ex. ws://echo.websocket.org/)�metavar�helpz-pz--proxyz$proxy url. ex. http://127.0.0.1:8080)r# z-vz --verboser �?�verbosezZset verbose mode. If set to 1, show opcode. If set to 2, enable to trace websocket module)�default�nargs�actionr r# z-nz--nocert�
store_truezIgnore invalid SSL cert)r( r# z-rz--rawz
raw outputz-sz--subprotocols�*zSet subprotocols)r'