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.0.0.tar.gz (233.1 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.0.0-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

specters-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for specters-3.0.0.tar.gz
Algorithm Hash digest
SHA256 f8775adc8a9c346e1acd014a4fee827d3dcb43e936ba751795e1e067635040b6
MD5 85113b4ad39314f433766e5e13419a7b
BLAKE2b-256 8d849684af117c1bb1bcbe1e318d707f6a181298a85bb366e8a934de8672b39f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for specters-3.0.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d98a1e02d58c61187c700913ba920bdae42be01970ea679228b33fed58ef41da
MD5 ec66d2ccb5420cb83c3e64719ac6c955
BLAKE2b-256 201cfdd627e1cdb0a75787da1b7c29a3e6df76c6f7e8366067be8df32d921d4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for specters-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9f6792a2feaa1990c9c6d060ec4162cf3e7d52f1fc9fbb33dcde86cc79dd6c82
MD5 878bb7f3170d854ddd06b16e7145304b
BLAKE2b-256 9280aff9830dbbca5a9968e72ed2fca42bdd0414d946cb8610d4e706ce9f9ff9

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