Skip to main content

A multi-threaded WSGI compiliant and secure web server

Project description

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

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

rocket3-20260520.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rocket3-20260520.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file rocket3-20260520.0.tar.gz.

File metadata

  • Download URL: rocket3-20260520.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for rocket3-20260520.0.tar.gz
Algorithm Hash digest
SHA256 4e3fdaf025e50bfca630b73a471e01a98c54e5cff5466d758aeb86c61f436fa8
MD5 b0cae128f9747b24dc61441c1bc0f640
BLAKE2b-256 474d45940d63546ba959c1c4af7f62889e67ac0ef2e7b908505c353b0a422f09

See more details on using hashes here.

File details

Details for the file rocket3-20260520.0-py3-none-any.whl.

File metadata

  • Download URL: rocket3-20260520.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for rocket3-20260520.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e5e896172acd2c270dbb49dc5bca25513e9b5f157b7583a5d767d3581cb0eea
MD5 3c524a2361cac405b30f46c1dfd63087
BLAKE2b-256 33fda86fbb73f6db6e98220bf48b96c594d92eff9f74a6fb2a68bd1b0afb3ec3

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