Skip to main content

Python bindings for Specter HTTP, WebSocket, HTTP/2, and HTTP/3 tunnel client

Project description

Specter

Python bindings for the Specter HTTP client with TLS, HTTP/2, HTTP/3, RFC 6455 WebSocket, and RFC 8441 Extended CONNECT support.

Installation

pip install specters

HTTP

import specter

builder = specter.Client.builder()
builder.fingerprint(specter.FingerprintProfile.Chrome142)
client = builder.build()

response = await client.get("https://example.com/").send()
print(response.status)
print(await response.text())

RFC 6455 WebSockets

import specter

builder = specter.Client.builder()
builder.cookie_store(True)
client = builder.build()

ws_builder = client.websocket("wss://example.com/socket")
ws_builder.subprotocol("chat.v1")
ws = await ws_builder.connect()

await ws.send_text("hello")
message = await ws.next()
await ws.close(specter.CloseFrame(specter.CLOSE_NORMAL, "done"))

RFC 8441 HTTP/2 Tunnels

import specter

builder = specter.Client.builder()
builder.http2_prior_knowledge(True)
client = builder.build()

tunnel = await client.websocket_h2("https://example.com/h2-tunnel").open()
await tunnel.send_bytes(b"raw bytes", end_stream=False)
data = await tunnel.recv_bytes()
await tunnel.close_send()

RFC 6455 framed WebSockets and RFC 8441 raw HTTP/2 tunnels are separate APIs by design.

License

MIT

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

specters-3.1.0.tar.gz (287.8 kB view details)

Uploaded Source

Built Distributions

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

specters-3.1.0-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

specters-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file specters-3.1.0.tar.gz.

File metadata

  • Download URL: specters-3.1.0.tar.gz
  • Upload date:
  • Size: 287.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for specters-3.1.0.tar.gz
Algorithm Hash digest
SHA256 a30f559caece0939e42a25a158aadd19b7f8ea7238d9d45146d7677cd22ad131
MD5 f3cb5240d414b6d8e4db84431c859c47
BLAKE2b-256 2349b0216978860872f585dce8bea27b3dd399af0bc54d839ac84028ed01b011

See more details on using hashes here.

File details

Details for the file specters-3.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for specters-3.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e371c52ea7d1347b9241024c4b49b5c60d36e6536a773be37232c18996b20f1c
MD5 d98f512fd05b5a001eb5982065a112b0
BLAKE2b-256 2d831b511644753107b8b49406142e8e16f11294e740655b2a48f871315fdd41

See more details on using hashes here.

File details

Details for the file specters-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for specters-3.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 51df87b67b9a53e95f95fc069c4a95cabb5302619d83bbe92741804266c6cdbe
MD5 8846a694234778c9be7996bef0d2f79e
BLAKE2b-256 3bd2fa304d6cf9bda4f6d44793f2ae8731bf9c4663f885aebf2d2e06e362d6a3

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