Post
Topic
Board Exchanges
Re: Bitfinex's streaming (websocket) api
by
bricky
on 14/04/2015, 19:37:27 UTC

I wasn't getting disconnected, but the socket went silent (after maybe a minute?) if I didn't reply to pings - maybe that's what's happening to you?  The implementation is actually very straightforward - take a look at the application-*.js file on the bitfinex site to see how they do it.

(never did a websocket client myself in node, so I can't help you on that front I'm afraid)

I thought it was that at first, but I keep getting the behavior you describe, even when I pong back. Are you authenticated?

No, I'm not authenticated.  Maybe you're not sending back the connection_id in your pong?

(I had posted a bunch of code here, but I think there's no point, you're almost certainly missing the connection_id)

This is what the pong should look like:

Code:
["websocket_rails.pong", {"data":{"connection_id": "%s" }}]

where the %s is your connection_id (you'll get that in your first 'client_connected' message you get back)

Did anyone gets a message on the depth.pair channel?

Yes (read the thread!)   Wink