1 from http.server import BaseHTTPRequestHandler, HTTPServer
2 from typing import Type, TypeVar, overload
4 from .handlers import SimpleHandler
5 from .types import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment
7 server_version: str # undocumented
8 sys_version: str # undocumented
9 software_version: str # undocumented
11 class ServerHandler(SimpleHandler): # undocumented
13 def close(self) -> None: ...
15 class WSGIServer(HTTPServer):
16 application: WSGIApplication | None
17 base_environ: WSGIEnvironment # only available after call to setup_environ()
18 def setup_environ(self) -> None: ...
19 def get_app(self) -> WSGIApplication | None: ...
20 def set_app(self, application: WSGIApplication | None) -> None: ...
22 class WSGIRequestHandler(BaseHTTPRequestHandler):
24 def get_environ(self) -> WSGIEnvironment: ...
25 def get_stderr(self) -> ErrorStream: ...
26 def handle(self) -> None: ...
28 def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ...
30 _S = TypeVar("_S", bound=WSGIServer)
33 def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: Type[WSGIRequestHandler] = ...) -> WSGIServer: ...
36 host: str, port: int, app: WSGIApplication, server_class: Type[_S], handler_class: Type[WSGIRequestHandler] = ...