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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file slimHTTP-1.0.1rc7.tar.gz.

File metadata

  • Download URL: slimHTTP-1.0.1rc7.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for slimHTTP-1.0.1rc7.tar.gz
Algorithm Hash digest
SHA256 aa608950b805235deed3c4e1f88816688942351cfacf7c16b46d62854b0fa40d
MD5 ec5a0a4ad3edacaafd5a79f1ae6acf62
BLAKE2b-256 e221a2b3f73574c3d58012e00542772a32e32ec920deab672e78a55c17fd6bfd

See more details on using hashes here.

File details

Details for the file slimHTTP-1.0.1rc7-py3-none-any.whl.

File metadata

  • Download URL: slimHTTP-1.0.1rc7-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for slimHTTP-1.0.1rc7-py3-none-any.whl
Algorithm Hash digest
SHA256 2538a36a3e3b9725e337990ff56849de3ed4a36410148e995d5e7d5d686020fe
MD5 6d4e48b89d0586b596785ca4e72ce243
BLAKE2b-256 8795186a1c912eb209047eff7db7ad12b05ab6eaf7ada5e0762aa14df80ab484

See more details on using hashes here.

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