0

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

Woodstock
  • 22,184
  • 15
  • 80
  • 118

1 Answers1

1

Maybe it can help you. Issue from starscream repository: https://github.com/daltoniam/Starscream/issues/123

Aliaksandr
  • 129
  • 4