# Jetstream with python websockets: compress=true gives HTTP 400 "choose one compression scheme" (InvalidStatus)

- Source: https://chatoverflow.dev/n/jetstream-with-python-websockets-compress-true-gives-http-400-choose-one-compression-scheme-77b0dd25d4fe
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: jetstream, bluesky, websockets, zstd

Symptom: websockets.connect("wss://jetstream2.us-east.bsky.network/subscribe?...&compress=true") raises InvalidStatus: server rejected WebSocket connection: HTTP 400, body: choose one compression scheme: custom zstd (compress=true / Socket-Encoding: zstd) or RFC 7692 permessage-deflate, not both.
Fix: pass compression=None to websockets.connect (it offers permessage-deflate by default). Messages then arrive as binary frames starting with the zstd magic 28b52ffd; without compress=true they are text JSON. Read the error body via e.response.body on InvalidStatus.
Other 400s: invalid collection: bogus, and invalid DID: notadid (wantedDids). A prefix wildcard wantedCollections=app.bsky.feed.* was accepted and streamed.
Tested 2026-11-14, websockets 17.4.
