eSrSSKJrJr SSKrSSKrSSKJr SSK J r Sr /SQr S\ -r \ "5S -\RR5S-r\ S -\-r"S S \5r"S S\5r"SS\5rSr\\4Sjr\S:Xaf\"SS\5r\R2R55r\"S\SS\SS5 SSKr\R<"S5 \R?5 SSS5 gg!,(df  g=f)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) WSGIServerWSGIRequestHandlerdemo_app make_server WSGIServer// c\rSrSr\rSrSrg) ServerHandlercURRURRSS5SUR5 [ R "U5 g![ R "U5 f=f)Nr r)request_handler log_requeststatussplit bytes_sentrcloseselfs ;/opt/imh/python3.13/lib/python3.13/wsgiref/simple_server.pyrServerHandler.close sY &  , , !!#a(+T__     %M   %s AAA4N)__name__ __module__ __qualname____firstlineno__software_versionserver_softwarer__static_attributes__rrrrs &O&r%rc4\rSrSrSrSrSrSrSrSr Sr g) r*z7BaseHTTPServer that implements the Python WSGI protocolNcP[R"U5 UR5 g)z.Override server_bind to store the server name.N)r server_bind setup_environrs rr)WSGIServer.server_bind0st$ r%c0=olURUS'SUS'[UR5US'SUS'SUS'SUS'g) N SERVER_NAMEzCGI/1.1GATEWAY_INTERFACE SERVER_PORT REMOTE_HOSTCONTENT_LENGTH SCRIPT_NAME) base_environ server_namestr server_port)renvs rr*WSGIServer.setup_environ5s\"$$!--M#,   !1!12MM  Mr%cUR$N applicationrs rget_appWSGIServer.get_app?sr%cXlgr;r<)rr=s rset_appWSGIServer.set_appBs&r%)r=r4) rrr r!__doc__r=r)r*r>rAr$rr%rrr*sAK   'r%rc0\rSrSrS\-rSrSrSrSr g)rGr crURRR5nURUS'URUS'UR US'SUR ;aUR RSS5up#O UR Sp2[RRUS5US'X1S 'URS US 'URRS 5cURR5US 'OURS US 'URRS5nU(aXAS'URR5H`upVUR!SS5R#5oVR%5nXQ;aM;SU-U;aUSU-==SU-- ss'MYXaSU-'Mb U$)NSERVER_PROTOCOLSERVER_SOFTWAREREQUEST_METHOD?rr0z iso-8859-1 PATH_INFO QUERY_STRINGr REMOTE_ADDRz content-type CONTENT_TYPEzcontent-lengthr2-_HTTP_,)serverr4copyrequest_versionserver_versioncommandpathrurllibparseunquoteclient_addressheadersgetget_content_typeitemsreplaceupperstrip)rr8rXquerylengthkvs r get_environWSGIRequestHandler.get_environKskk&&++-!%!5!5 !%!4!4  $   $)) Q/JD2!<<//lCK#N!003M <<  N + 3"&,,"?"?"AC "&,,~">C !!"23 $* !LL&&(DAiiC &&(AGGI!xqyCGAI#a%'!"GAI) r%c"[R$r;)sysstderrrs r get_stderrWSGIRequestHandler.get_stderrls zzr%cURRS5Ul[UR5S:a'SUlSUlSUlURS5 gUR5(dg[URURUR5UR5SS9nXl URURR!55 g)zHandle a single HTTP requestiir0iNF) multithread)rfilereadlineraw_requestlinelen requestlinerUrW send_error parse_requestrwfilermrhrrunrSr>)rhandlers rhandleWSGIRequestHandler.handleos $zz2259 t## $u ,!D #%D DL OOC !!##  JJ DOO$5t7G7G7I #' DKK'')*r%)rWrsrUruN) rrr r! __version__rVrhrmr{r$rr%rrrGs"[0NB+r%rcSSKJn U"5n[SUS9 [US9 [UR 55nUHupV[US[ U5US9 M U"SS/5 UR 5RS5/$) Nr)StringIOz Hello world!)file=z200 OK)z Content-Typeztext/plain; charset=utf-8zutf-8)iorprintsortedr`reprgetvalueencode)environstart_responserstdouthrfrgs rr r su ZF .v& vw}}A aDG&)8JKL OO  $ $W - ..r%c<U"X4U5nURU5 U$)zACreate a new WSGI server listening on `host` and `port` for `app`)rA)hostportapp server_class handler_classrSs rr r s#4, 6F NN3 Mr%__main__r0i@zServing HTTP onrrz...zhttp://localhost:8000/xyz?abc) rC http.serverrrrk urllib.parserYwsgiref.handlersrplatformrr}__all__rVversionr sys_versionr"rrrr r rhttpdsocket getsocknamesar webbrowseropenhandle_requestrr%rrs ; ** I,#%+ckk.?.?.A!.DD !C'+5 &M &'':;+/;+~ /#-