Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websockets not working #5

Open
manuel2258 opened this issue Nov 8, 2018 · 4 comments
Open

Websockets not working #5

manuel2258 opened this issue Nov 8, 2018 · 4 comments

Comments

@manuel2258
Copy link

I tried to initiate a websocket connection using the following example you have posted into your README:
def openTickerStream():
cob = Cobinhood()
cobeth_orderbook = Orderbook('COB-ETH')
cob.ws.start(subscribe=[cobeth_orderbook], on_message=on_message)

def on_message(cob_obj, msg):
print (cob_obj.system.get_time())
print (cob_obj.ws.exchange_data.orderbook)
print (msg)
Using this code, there is no response at all. Maybe the websocket endpoint is outdated?

@snapo
Copy link

snapo commented Nov 13, 2018

same here...

@manuel2258
Copy link
Author

same here...

The way they use the websocket-client does not work anymore in the version 2 of the cobinhood websocket. If you still looking into implementing one yourself, create a new thread that calls the receive function of the ws client. Also make sure to ping the server every 60sec or the connection will be drooped. Also if you are looking into using the ticker, that does not work well either, however the orderbook does.

@Ruslan992
Copy link

Sorry, I am new to programming and still can not figure out how to get an orderbook using websocket. I realized that the library no longer works, do you happen to have some alternative method? Or, perhaps, you can show sample code, how can I get an order book using only the websocket library. I can’t find exactly the sample code anywhere, and unfortunately, the information from the official site is not enough for me. If it's not too much trouble, can you help me?

@manuel2258
Copy link
Author

Sure, write me a email, otherwise I might forget it ...
You should be able to see it on my github profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants