GithubHelp home page GithubHelp logo

websocket's People

Contributors

happiness123 avatar waitandsee-rabbit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

websocket's Issues

ok_sub_spot_btc_usd_depth invalid subscription event!

Hello,

I have an issue for ok_sub_spot_btc_usd_depth.

Request

{'event':'addChannel','channel':'ok_sub_spot_btc_usd_depth'}

I'm getting this error.

[{"binary":0,"data":{"result":false,"error_msg":"The subscription event type is invalid.","error_code":20103}}]

Can you help me please?

Best Regards

For people having issues, here is the correct data.

You have to use this configuration to get it working:
wss://real.okex.com:10441/websocket
{'event':'addChannel','channel':'ok_sub_spot_usd_btc_ticker'}
{'event':'addChannel','channel':'ok_sub_spot_usd_btc_depth_20'}

okcoin.cn error: 'str' does not support the buffer interface

okcoin_websocket.py works fine if url = okcoin.com

if __name__ == "__main__":
    url = "wss://real.okcoin.com:10440/websocket/okcoinapi"      #if okcoin.cn  change url wss://real.okcoin.cn:10440/websocket/okcoinapi

but if I change url to okcoin.cn, I've got this error:
'str' does not support the buffer interface
(python 3.4.4)

HTML版本里send到底是什么东东?

doSend("{'event':'addChannel','channel':'ok_sub_spotcny_btc_kline_1min'}");

为什么不用标准的Stringify的JSON? 调用这个JSON.stringify()获得。后台收到后Parse也很方便。我看了Java的实例代码,也同样用的是类似的方法。

Java Demo won't work and got disconnected

How To
Execute the com.okcoin.websocket.test.Example.java

Experienced Behavior
As soon as the line 36 is executed, the Web Socket Client got disconnected:
client.addChannel("ok_sub_spotusd_btc_ticker");

Then it keep getting disconnected due to the reconnecter / re-subscription mechanism (c.f. com.okcoin.websocket.WebSocketBase#MoniterTask.java).

The program output:

WebSocket Client connected!
WebSocket Client disconnected!
WebSocket Client connected!
[INFO] 2018-03-16 08:28:31,888 BuissnesWebSocketServiceImpl.java:17:WebSocket Client received message: {"event":"pong"}
WebSocket Client disconnected!
WebSocket Client connected!
[INFO] 2018-03-16 08:28:41,814 BuissnesWebSocketServiceImpl.java:17:WebSocket Client received message: {"event":"pong"}
WebSocket Client disconnected!
WebSocket Client connected!
[INFO] 2018-03-16 08:28:51,793 BuissnesWebSocketServiceImpl.java:17:WebSocket Client received message: {"event":"pong"}
WebSocket Client disconnected!

Solution
It seems that the com.okcoin.websocket.WebSocketBase.addChannel(String channel) build the wrong data message. From the ws_request documentation, the binary field is an integer (0, 1), not a boolean.

Changing the add channel data message to the following value seems to solve the problem:
String dataMsg = "{'event':'addChannel','channel':'" + channel + "','binary':0}";.

What timezone is used for date in `ok_sub_spot_X_deals` responses ?

What timezone is used for date in ok_sub_spot_X_deals responses ? Currently I get this

[{"binary":1,"channel":"ok_sub_spot_ltc_btc_deals","data":[["145159335","0.01868501","0.02999999","21:19:11","ask"]]}]

It looks like it's GMT+8 time but I want to make sure. Also could you send epoch instead ? It's more reliable.

Python Okex websocket - return invalid bytes that jason can't decode.

Starting from today, websocket api returns following value when I subscribe to "ok_sub_futureusd_btc_depth_this_week_10"channel:

b'M\xca1\n\x800\x0c\x05\xd0\xbb\xfc\xd9A\xd7\xae\x1eC$\xa4&\xa2(U\xda\x04\x15\xf1\xee.\x0e\x8e\x0f^w#\xce\x89\xf3\x85\xd0T\x18&NIW\x04\xb0H\xfb\xa1\x82\xb01\xc2\x8d\xac\xc5WC\xb0\xec\xfa\xcf\xdbB\xc5#\x8dn\x9e\xd5\x8bP\xb4\x81Dw\x9b(\xe9it\xa8.\xd4\xd4x\x9e\xfe\x05'
2018-10-29 23:01:16,578 - root - ERROR - Expecting value: line 1 column 1 (char 0)

Jason.loads() can't decode it. Anyone has similar issue or knows what's going on?

Thanks,

websocket 用户交易相关的说明文档有吗。

您好
请问websocket 用户交易相关的说明文档有吗。github上的文档不全啊。没有相关参数说明。我发送了login请求反应答应状态  20116 :参数不匹配

麻烦给一份相关的说明文档呗,谢谢

can't automatically notify me if the order has filled or canceled. Can't check two orders at the same time

websocket.send("{'event':'addChannel', 'channel':'ok_spotcny_order_info', 'parameters': { 'api_key':'XXXX','symbol':'XXXX','order_id':'XXXX','sign':'XXXX' }}");

I have to check the order once a second by myself.
And addChannel twice every second if I have two orders.

我addChannel只收到第一次status=0的, 当被买进去成交了, 并没有通知过来
当我自己撤销了这个订单, 也没有通知我, 这时应该通知给我status=-1:已撤销了
我只能我隔一秒查询一下订单状态
webservice也不支持批量查订单状态,[{"channel":"ok_spotcny_order_info","data":{"orders":[],"result":true}}] 如果我的订单号用逗号隔开,就返回这样的

HTML Demo does not work

Actually I was looking for a JS / node example. So I simply tried the web example.
I did set the API Key and Secret. What happens is a website showing me:

ERROR: undefined
DISCONNECTED

Is that example still working?

event does not exists?

okCoinWebSocket.websocket.send("{'event':'addChannel','channel':'ok_btcusd_ticker'}");
but return
{"result":false,"error_msg":"param not match.","error_code":20116}

real.okcoin.cn: no such host

2018/08/07 18:54:27 errrr dial tcp: lookup real.okcoin.cn: no such host

Is the connection restricted for some countries?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.