Skip to main content

A sans-IO-backed ASGI server and HTTP client for without: h11/h2/wsproto over asyncio sockets.

Project description

without-http

A sans-IO-backed ASGI server and HTTP client for without. Where without-asgi is the app side of the ASGI boundary (it turns a server's receive/send into typed streams), without-http is the server side: it owns the socket and the HTTP wire protocol, and drives any ASGI app via app(scope, receive, send).

The wire-protocol state machines are themselves sans-IO libraries: h11 for HTTP/1.1, h2 for HTTP/2, and wsproto for WebSockets. without-http reads and writes socket bytes with asyncio, feeds them through those state machines, and uses without-asgi's server-direction codecs to translate between typed events and the ASGI dicts an app expects.

from without import sleep_forever
from without_asgi import make_asgi_app
from without_http import ConnectionPool, serving

app = make_asgi_app(lifespan, http=router.dispatch, websocket=sockets.dispatch)

async with serving(app, host="127.0.0.1", port=8000):
    await sleep_forever()   # run until cancelled

async with ConnectionPool() as pool:
    async with pool.request("GET", "http://127.0.0.1:8000/items") as (head, body):
        assert head.status == 200
        data = await body.read()

Because without-http speaks plain ASGI to the app, any ASGI app runs over it, interchangeably with uvicorn. The server handles TLS, HTTP/2 (by ALPN or prior knowledge), keep-alive, WebSockets over the HTTP/1.1 upgrade, per-handler isolation, and flow control. The client is a ConnectionPool with a (head, body) response split, buffered and streaming bodies in both directions, opt-in trailers, HTTP/2 multiplexing, and stack-composed middleware.

See the without-http guide (with the API reference) for the full surface, including the deferred work (WebSockets over HTTP/2, HTTP/3, duplex).

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

without_http-0.0.1.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

without_http-0.0.1-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file without_http-0.0.1.tar.gz.

File metadata

  • Download URL: without_http-0.0.1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_http-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5a2858ae3fa5a8a8a269dbf47eca53a0a19f36e0070499c6b772011bedefd8d8
MD5 45fbf892ea775ae4196571ad92c750f4
BLAKE2b-256 71ebed3f9230108f7feadbb2bb59697889e23ebd5b05b9a9829e6b637c5ef9f9

See more details on using hashes here.

File details

Details for the file without_http-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: without_http-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for without_http-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9e31cca3b1479698080b7a546cf1935df2b9e87d2d99d53d515797fc8c9bce
MD5 b688f1c5eee52199fce1874c4c29dc77
BLAKE2b-256 dfcff24649e6e7283a238ca320db9d3fdd6a513602bf3a6e5d648ade21e95835

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