Rocket3
Rocket3 is the multi-threaded WSGI web server used by web2py and py4web, stripped of all the Python 2 logic and dependencies. It supports Python 3.9+ and can be used without web2py or py4web.
Rocket was originally developed by Massimo Di Pierro, then rewritten much better by Timothy Farrell, and then has had refactorings made by Massimo and other web2py contributors.
Installation
pip install rocket3
Example
from rocket3 import Rocket3 as Rocket
def demo_app(environ, start_response):
"""simple example WSGI app"""
start_response("200 OK", [("Content-Type", "text/html")])
return [b"<html><body><h1>Hello from Rocket Web Server</h1></body></html>"]
server = Rocket(("0.0.0.0", 8080), "wsgi", {"wsgi_app": demo_app})
server.start()
HTTPS
Pass a 4-tuple (host, port, key_file, cert_file) to serve over TLS, or a 5-tuple (host, port, key_file, cert_file, ca_cert_file) to also request a client certificate:
server = Rocket(
("0.0.0.0", 8443, "key.pem", "cert.pem"),
"wsgi",
{"wsgi_app": demo_app},
)
server.start()
Built-in demo
A trivial server that serves static files (or a hello page if no static folder is given) is bundled as rocket3.demo:
python -c "from rocket3 import demo; demo()" -i 127.0.0.1 -p 8000 -s ./static
Development
The project uses uv and ruff. Common targets:
make check # ruff check
make format # ruff format
make test # run the test suite
make build # build sdist + wheel
make publish # upload to PyPI
License
BSDv3
Metadata
Release files for rocket3 20260526.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rocket3-20260526.0.tar.gz | 20.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rocket3-20260526.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.9 kB
Release files / rocket3-20260526.0.tar.gz
| Download URL | rocket3-20260526.0.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5828422badec10e45bf18f837f14d3022c98b19ac66dbb8fbaafdb17f8d4cdb3
|
|
BLAKE2b-256 checksum How to use checksums |
caf7fed13d11a5c93e19daddf1fa73ce09fcdb58b43ce2ae95a653150dd3bcca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / rocket3-20260526.0-py3-none-any.whl
| Download URL | rocket3-20260526.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a114cb9691857916dfabc038b56f9b6099171df7da6fa5e113b0a4fede6fa52b
|
|
BLAKE2b-256 checksum How to use checksums |
db91638d75407c7076f954faf7997a6c3dcbc8a3978a193f6a096e350fe12419
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|