⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib64
/
python3.9
/
wsgiref
/
__pycache__
/
View File Name :
simple_server.cpython-39.opt-1.pyc
a �����DOg3����������������������@���s2��d�Z�ddlmZmZ�ddlZddlZddlmZ�ddl m Z �dZg�d�Zde�Z e ��d �ej���d��Ze d �e�ZG�dd��de�ZG�d d��de�ZG�dd��de�Zdd��Zeefdd�Zedk�r.edde��LZej���Zeded�ded�d��ddlZe�d��e����W�d����n1��s$0����Y��dS�)a!��BaseHTTPServer that implements the Python WSGI protocol (PEP 3333) This is both an example of how WSGI can be implemented, and a basis for running simple web applications on a local machine, such as might be done when testing or debugging an application. It has not been reviewed for security issues, however, and we strongly recommend that you use a "real" web server for production use. For example usage, see the 'if __name__=="__main__"' block at the end of the module. See also the BaseHTTPServer module docs for other API information. �����)�BaseHTTPRequestHandler� HTTPServerN)� SimpleHandler)�python_implementationz0.2)� WSGIServer�WSGIRequestHandler�demo_app�make_server�WSGIServer/�/� c�������������������@���s���e�Zd�ZeZdd��ZdS�)� ServerHandlerc�������������� ���C���s>���z,|�j��|�j�dd�d�|�j��W�t�|���nt�|���0�d�S�)Nr�������r���)�request_handlerZlog_request�status�splitZ bytes_sentr����close��self��r����-/usr/lib64/python3.9/wsgiref/simple_server.pyr��� ���s �����zServerHandler.closeN)�__name__� __module__�__qualname__�software_versionZserver_softwarer���r���r���r���r���r ������s���r ���c�������������������@���s4���e�Zd�ZdZdZdd��Zdd��Zdd��Zd d ��ZdS�)r���z7BaseHTTPServer that implements the Python WSGI protocolNc�����������������C���s���t��|���|�����dS�)z.Override server_bind to store the server name.N)r����server_bind� setup_environr���r���r���r���r���0���s���� zWSGIServer.server_bindc�����������������C���sF���i��}|�_�|�j|d<�d|d<�t|�j�|d<�d|d<�d|d<�d|d<�d�S�) NZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PORT���REMOTE_HOST�CONTENT_LENGTHZSCRIPT_NAME)�base_environZserver_name�strZserver_port)r����envr���r���r���r���5���s���� zWSGIServer.setup_environc�����������������C���s���|�j�S��N��applicationr���r���r���r����get_app?���s����zWSGIServer.get_appc�����������������C���s ���||�_�d�S�r#���r$���)r���r%���r���r���r����set_appB���s����zWSGIServer.set_app) r���r���r����__doc__r%���r���r���r&���r'���r���r���r���r���r���*���s��� r���c�������������������@���s,���e�Zd�Zde�Zdd��Zdd��Zdd��ZdS�) r���r ���c�����������������C���sP��|�j�j���}|�j|d<�|�j|d<�|�j|d<�d|�jv�rH|�j�dd�\}}n|�jd�}}tj � |d�|d<�||d <�|����}||�jd �kr�||d<�|�jd �|d<�|�j �d �d�u�r�|�j ���|d<�n|�j d �|d<�|�j �d�}|r�||d<�|�j ���D�]`\}}|�dd����}|���}||v��rq�d|�|v��r>|d|���d|�7��<�q�||d|�<�q�|S�)NZSERVER_PROTOCOLZSERVER_SOFTWAREZREQUEST_METHOD�?r���r���z iso-8859-1Z PATH_INFOZQUERY_STRINGr���r���ZREMOTE_ADDRzcontent-typeZCONTENT_TYPEzcontent-lengthr����-�_ZHTTP_�,)�serverr ����copy�request_version�server_version�command�pathr����urllib�parse�unquoteZaddress_stringZclient_addressZheaders�getZget_content_type�items�replace�upper�strip)r���r"���r2����query�host�length�k�vr���r���r����get_environK���s6���� zWSGIRequestHandler.get_environc�����������������C���s���t�jS�r#���)�sys�stderrr���r���r���r���� get_stderrp���s����zWSGIRequestHandler.get_stderrc�����������������C���s����|�j��d�|�_t|�j�dkr<d|�_d|�_d|�_|��d��dS�|����sHdS�t |�j�|�j |����|����dd�}|�|_ |�|�j�����dS�)zHandle a single HTTP requesti��i���r���i���NF)Zmultithread)Zrfile�readlineZraw_requestline�lenZrequestliner/���r1���Z send_errorZ parse_requestr ���ZwfilerC���r@���r����runr-���r&���)r����handlerr���r���r����handles���s���� �zWSGIRequestHandler.handleN)r���r���r����__version__r0���r@���rC���rH���r���r���r���r���r���G���s���%r���c�����������������C���sr���ddl�m}�|��}td|d��t|d��t|�����}|D�]\}}t|dt|�|d��q8|ddg��|����d�gS�) Nr���)�StringIOzHello world!)�file�=z200 OK)zContent-Typeztext/plain; charset=utf-8zutf-8)�iorJ����print�sortedr7����repr�getvalue�encode)�environZstart_responserJ����stdout�hr>���r?���r���r���r���r�������s���� r���c�����������������C���s���||�|f|�}|��|��|S�)zACreate a new WSGI server listening on `host` and `port` for `app`)r'���)r<����portZappZserver_classZ handler_classr-���r���r���r���r �������s���� r ����__main__r���i@��zServing HTTP onrV���r���z...zhttp://localhost:8000/xyz?abc) r(���Zhttp.serverr���r���rA����urllib.parser3���Zwsgiref.handlersr����platformr���rI����__all__r0����versionr����sys_versionr���r ���r���r���r���r ���r���Zhttpd�socket�getsockname�sarN���Z webbrowser�openZhandle_requestr���r���r���r����<module>���s.���C �