Issues using Starscream with the Poloniex WAMP API

666 Views Asked by At

I'm trying to use Starscream (which is great) to connect to the Poloniex (cryptocurrency exchange) API to retrieve live quotes for prices over socket connection.

I have been successful using Autobahn, in connecting and subscribing in Python.

Now on iOS I'm having trouble (using Swift).

This is how I'm preparing the socket.

self.socket = WebSocket(url: URL(string: "wss://api.poloniex.com")!, protocols: ["ticker"])

However, I get a disconnect delegate call with the error:

(Error Domain=WebSocket Code=400 "Invalid HTTP upgrade" UserInfo={NSLocalizedDescription=Invalid HTTP upgrade}

Any ideas what I'm doing wrong? Is this the correct way to subscribe using Starscream?

Help appreciated.

John

0

There are 0 best solutions below