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.2

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.2.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.2-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reactor_server-2.2.2.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.6.87.1-microsoft-standard-WSL2

File hashes

Hashes for reactor_server-2.2.2.tar.gz
Algorithm Hash digest
SHA256 b0dc96f2f976457d6ccc24f12a97f50434e2be8c18993f743ebf8b559f1e7a2b
MD5 ab461bb012647753de3904fbfd05de0f
BLAKE2b-256 c870ff32033fa414c960d3668b42bbb63725ff608808ccb657aaace2047a0f9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reactor_server-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.12.12 Linux/6.6.87.1-microsoft-standard-WSL2

File hashes

Hashes for reactor_server-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 840a2dc46bdf4bd3c2c5e1d8d8d00d776cba2ee2c21d8e7013dd3452ed3f7f8a
MD5 a961d7d87028f1f92d0d5a997209829f
BLAKE2b-256 b2c3785e4e519821525d6cedcc767a5f00be90eed448ed667ae31714cf935c24

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