No response from PubSub servers

I’ve been attempting to connect to pubsub servers in order to listen in on channel points redemptions, but I haven’t been able to get a single response from a server. I send a request, await a response, but nothing happens until eventually it crashes. I’ve been stumped on this for a while. Here is my (python) code:

file

I’m a beginner to everything to do with twitch API, but I’ve read the entire documentation for PubSub several times, so I’d appreciate any help.

You need to JSON Encode your request before you websocket.send