A minimalistic non-threaded HTTP server written in Python. Supports REST & WebSockets¹.
Project description
A simple, minimal and flexible HTTP server.
Supports modules for parsing WebSocket¹ traffic as well as REST api routes.
- slimHTTP documentation
- slimHTTP discord server
Supports
- REST routes (
@http.route('/some/endpoint')
) - websockets if
@http.on_upgrade
is defined using spiderWeb ¹ - Static file emulation with
@http.route('/example.html')
- vhosts
- ssl/tls
- No threading or threads used (fully relies on
epoll()
(select()
on Windows)) - flexible configuration for webroots etc via
@http.configuration
Minimal example
import slimhttpd
http = slimhttpd.host(slimhttpd.HTTP)
while 1:
for event, *event_data in http.poll():
pass
The only important thing is that .poll()
has to be called in order to process the events.
Footnote
It's not pretty down here. But it'll do in a pinch.
Project details
Release history Release notifications | RSS feed
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.1rc3.tar.gz
(14.7 kB
view hashes)
Built Distribution
Close
Hashes for slimHTTP-1.0.1rc3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c677aae2af6dd276f5827f3250dca9211212f760edef4382d9a0ee48fb9c3732 |
|
MD5 | eb69dda8558cea6c31c07cf2e6fada7b |
|
BLAKE2b-256 | 91968cc34100752349c50ee226e082f9f657fb9d750b88176a0af454859e0807 |