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-20260526.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

rocket3-20260526.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rocket3-20260526.0.tar.gz
Algorithm Hash digest
SHA256 5828422badec10e45bf18f837f14d3022c98b19ac66dbb8fbaafdb17f8d4cdb3
MD5 4bd413cb4a6ca32fc4d27046fda804da
BLAKE2b-256 caf7fed13d11a5c93e19daddf1fa73ce09fcdb58b43ce2ae95a653150dd3bcca

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rocket3-20260526.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a114cb9691857916dfabc038b56f9b6099171df7da6fa5e113b0a4fede6fa52b
MD5 287d09b205a8dc37c158c68957f3fc1c
BLAKE2b-256 db91638d75407c7076f954faf7997a6c3dcbc8a3978a193f6a096e350fe12419

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