I have some sample code in Python that works fine to open a websocket to stream BTC-USD tickers for example, but when I send the exact same subscribe message (verified JSON is the same) to a socket opened in Swift, the socket just shuts down (read-side closed) and I get a Code 57, “Socket is not connected”. My socket code in Swift works fine in Coinbase Pro, but I just can’t get it to work with wss://advanced-trade-ws.coinbase.com. I know this is vague, but any thoughts on how to troubleshoot?
Here’s a sample message sent out: {“timestamp”:“1700336427”,“signature”:“c26f448e604651ed7e642771d19afe2f2b6180aa638a08da736f94ccf5b1baf4”,“type”:“subscribe”,“channel”:“heartbeat”,“api_key”:“—redacted—”,“product_ids”:[“BTC-USD”]}