Skip to main content

A minimalistic non-threaded HTTP server written in Python. Supports REST & WebSockets¹.

Project description

drawing

A no-dependency, simple, minimal and flexible HTTP server written in Python.
Supports: REST, WebSocket¹, vhosts, reverse proxy and static file delivery.

Features

  • No dependencies or additional requirements
  • REST routes (@http.route('/some/endpoint'))
  • websockets using plugin spiderWeb ¹
  • Can emulate files via @http.route('/example.html')
  • vhosts
  • TLS (SSL)
  • reverse proxy
  • .py extensions in web-root/vhosts without having to use FastCGI
  • No threads used by default (fully relies on epoll() and select() on Windows)
  • flexible runtime configuration and re-configuration (using annotation @http.configuration)

Installation

The project is hosted on PyPi and can be installed with pip.

sudo pip install slimHTTP

But it can also be cloned manually (or downloaded)

git clone https://github.com/Torxed/slimHTTP

Minimal example

import slimHTTP

http = slimHTTP.host(slimHTTP.HTTP)
http.run()

Serves any files under /srv/http by default in HTTP mode.

Footnote

It's not pretty down here. But it'll do in a pinch.

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

slimHTTP-1.0.1rc7.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

slimHTTP-1.0.1rc7-py3-none-any.whl (34.9 kB view hashes)

Uploaded Python 3

Supported by

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