Connecting to the websocket - 1006 error

I’m trying to connect to the websocket to get access to order updates. I’m using the faye-websocket-ruby gem and the code seems pretty straightforward. When I run the code I immediately get a “close, 1006” message.

I’ve tried sending the authentication JSON after the connection opens, but I don’t think it’s even getting past ws =‘’)

Do I have the correct endpoint? Anyone else struggling with the same thing?

  def listen {
          ws ='')
      ws.on :open do |event|
        p [:open]

      ws.on :message do |event|
        p [:message,]

      ws.on :close do |event|
        p [:close, event.code, event.reason]
        ws = nil

Disregard - I figured it out.

Had the wrong endpoint, and for anyone else using Ruby, you need to use the MessagePack gem to unpack the messages received from the stream.