Skip to main content

Warpsock

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

Supported Chrome fingerprints are warpsock.FingerprintProfile.Chrome142 through warpsock.FingerprintProfile.Chrome148. Supported Firefox fingerprints are warpsock.FingerprintProfile.Firefox133 through warpsock.FingerprintProfile.Firefox151, plus ESR branches FirefoxEsr115, FirefoxEsr128, and FirefoxEsr140; examples use Chrome148, the latest implemented Chrome profile.

Installation

pip install warpsock

HTTP

Synchronous HTTP:

import warpsock

builder = warpsock.SyncClient.builder()
builder.fingerprint(warpsock.FingerprintProfile.Chrome148)
client = builder.build()

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

Async HTTP:

import warpsock

builder = warpsock.AsyncClient.builder()
builder.fingerprint(warpsock.FingerprintProfile.Chrome148)
client = builder.build()

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

RFC 6455 WebSockets

import warpsock

builder = warpsock.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(warpsock.CloseFrame(warpsock.CLOSE_NORMAL, "done"))

RFC 8441 HTTP/2 Tunnels

import warpsock

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

tunnel = await client.websocket_h2("https://example.com/h2-tunnel").connect()
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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

warpsock-4.3.0.tar.gz (2.5 MB view details)

Uploaded Source

Built Distributions

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

warpsock-4.3.0-cp310-abi3-manylinux_2_28_x86_64.whl (12.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

warpsock-4.3.0-cp310-abi3-manylinux_2_28_aarch64.whl (11.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

warpsock-4.3.0-cp310-abi3-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

warpsock-4.3.0-cp310-abi3-macosx_10_13_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.10+macOS 10.13+ x86-64

File details

Details for the file warpsock-4.3.0.tar.gz.

File metadata

  • Download URL: warpsock-4.3.0.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for warpsock-4.3.0.tar.gz
Algorithm Hash digest
SHA256 2572672023dd5ee0b673605c07c118102b3b25b7980d75ce2c025bc811ad6b64
MD5 38178174a21ba28274191d8eb60842d2
BLAKE2b-256 db19cd493bce05ffa719404285ea070967598e7cd056eeb2018c047d144dbefd

See more details on using hashes here.

File details

Details for the file warpsock-4.3.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for warpsock-4.3.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6bbca749c853832e1e255659a433de51ca7a7c17b4ee0793d56ecfc54c81e347
MD5 7dc3ad5add5452166d64e33a01b5b527
BLAKE2b-256 07dcc4a8a7321b123b9161492bed723f067e44e801b8bef981b8d2a590d05a41

See more details on using hashes here.

File details

Details for the file warpsock-4.3.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for warpsock-4.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 998adcc83dbaa8b653d86cc6f5468f52318350826ec4856530cf0e601da91197
MD5 590b606aba7741217f4122b65f2ebb3b
BLAKE2b-256 c6d9cfde2594a9c3fdd2e6b1b0029bfae5033858fdaacb1fecd1659e20226168

See more details on using hashes here.

File details

Details for the file warpsock-4.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for warpsock-4.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 71b6e8a4617102c1fbde9d1dc444b05145bcf83a1e44e7b3e92eb5032ac379d0
MD5 343b717f1d5ec0afb4c5852ac52b6c11
BLAKE2b-256 2061d5a626992162ef4985b78fbccb9a89ad43e1341e5d69c202e3ce32919a9a

See more details on using hashes here.

File details

Details for the file warpsock-4.3.0-cp310-abi3-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for warpsock-4.3.0-cp310-abi3-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 41bbe2ec8b53860e5333aacf924832ece5109dab0b748d461252ba9668351332
MD5 e48c2e3a93c753a71bfa35d9ab524085
BLAKE2b-256 df384ee572f0101562df8cb81ccb6bec4ca9713dbc745097156731f237a21ace

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.3.0 This release

5 files

4.2.8

5 files

4.2.7

5 files

4.2.5

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page