{"id":23864,"library":"httpserver","title":"httpserver","description":"Asyncio implementation of an HTTP server. Version 1.1.0 provides a simple, async HTTP server built on asyncio. Release cadence is low; last release was 2023.","status":"active","version":"1.1.0","language":"python","source_language":"en","source_url":"https://github.com/thomwiggers/httpserver","tags":["asyncio","http","server"],"install":[{"cmd":"pip install httpserver","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Common mistake: importing the module without accessing the class.","wrong":"import httpserver","symbol":"HTTPServer","correct":"from httpserver import HTTPServer"},{"note":"RequestHandler is exposed at the package level, not in a submodule.","wrong":"from httpserver.server import RequestHandler","symbol":"RequestHandler","correct":"from httpserver import RequestHandler"},{"note":"","wrong":"","symbol":"get_handler","correct":"from httpserver import get_handler"}],"quickstart":{"code":"import os\nfrom httpserver import HTTPServer, RequestHandler\n\nclass HelloHandler(RequestHandler):\n    def do_GET(self):\n        self.send_response(200)\n        self.send_header('Content-type', 'text/plain')\n        self.end_headers()\n        self.wfile.write(b\"Hello, world!\")\n\nserver = HTTPServer(('localhost', 8080), HelloHandler)\nprint('Server running on http://localhost:8080')\nserver.serve_forever()","lang":"python","description":"Creates a simple HTTP server responding with 'Hello, world!' on GET requests."},"warnings":[{"fix":"Make handler methods async or offload blocking calls to executor.","message":"The server runs on the event loop; ensure your handler methods are not blocking or use async callbacks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Evaluate if the library meets long-term needs.","message":"The library is minimally maintained. For production, consider aiohttp or sanic.","severity":"deprecated","affected_versions":"*"},{"fix":"Change from HTTPServer('localhost', 8080, ...) to HTTPServer(('localhost', 8080), ...).","message":"In version 1.1.0, the signature of HTTPServer changed: the first argument is now a tuple (host, port) instead of separate arguments.","severity":"breaking","affected_versions":"<1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from httpserver import HTTPServer'.","cause":"Incorrect import path; HTTPServer is a class in the httpserver module.","error":"ImportError: cannot import name 'HTTPServer' from 'httpserver'"},{"fix":"Pass address as tuple: HTTPServer(('localhost', 8080), MyHandler).","cause":"Passing host and port as separate arguments to HTTPServer in version 1.1.0.","error":"TypeError: __init__() takes 1 positional argument but 3 were given"},{"fix":"Import directly from httpserver: from httpserver import HTTPServer.","cause":"Trying to import from a submodule that doesn't exist.","error":"AttributeError: module 'httpserver' has no attribute 'server'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}