Skip to main content

reactor http server

Project description

reactor

A minimal HTTP server implementing the Reactor pattern in Python. Designed for learning event-driven network programming.

This project aims to demonstrate how to implement a Reactor-based HTTP server from scratch in Python.

Core components such as Buffer, HTTP request parser, and HTTP response builder are implemented manually to illustrate event-driven network programming.

Version

2.2.1

install

pip install reactor-server

example:

import os

from reactor_server.http_server.eventloop import EventLoop
from reactor_server.http_server.server import Server
from reactor_server.http_server.settings import BASE_DIR

if __name__ == '__main__':
    os.chdir(os.path.join(BASE_DIR))
    Server(loop_cls=EventLoop, thread_num=10).run()

Reactor-based HTTP Server (Python)

  • Implemented a non-blocking HTTP server using the Reactor pattern

  • Built custom Buffer, Request parser, and Response builder

  • Implemented static file serving and directory listing

  • Designed multi-reactor architecture with threadpool

  • Handled partial read/write and TCP connection lifecycle

  • Others maybe done in the future

Contributions are welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reactor_server-2.2.1.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reactor_server-2.2.1-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file reactor_server-2.2.1.tar.gz.

File metadata

  • Download URL: reactor_server-2.2.1.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for reactor_server-2.2.1.tar.gz
Algorithm Hash digest
SHA256 dcfc869bd064145ad9ce501a0f70ddd8d4002e0984d06e08dee729c80e2cb43f
MD5 4d8ad828bcdc3a71a418082a83ded143
BLAKE2b-256 15d822cb9c0aa62fda5ca885966638b1b88755ea2fbe172b039fe9f9c8834900

See more details on using hashes here.

File details

Details for the file reactor_server-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: reactor_server-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for reactor_server-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49b5889d614ce8962a76a79570a3c761133ddb84b77cfcd9231d6d6296f13060
MD5 03f930699b54fb2277fd8b743fae685a
BLAKE2b-256 163900d0c6c81e590ce0271d143fe29fe5d37e8c7d20d2065dd60bbb89724e88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page