Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Websocket auth request expired #37

@moranelli

Description

@moranelli

Hi,
I am trying to subscribe to position or order and I don't get data because the auth failed. The problem is that the websocket not raise any exception. I debug the websocket and I can see the error:

msg_json:  {'success': False, 'ret_msg': 'error:request expired', 'conn_id': '31950833-ab7d-4fd2-8b1c-1dc1b7205ae2', 'request': {'op': 'auth', 'args': ['bqZTxSi30b', '1622325037946', '2dab68953beb4d27bc4c1257f1f594dabc9abb631']}}
msg_json:  {'success': False, 'ret_msg': 'error:topic:order needs auth first', 'conn_id': '31950833-ab7d-4f1c-1dc1b7205ae2', 'request': {'op': 'subscribe', 'args': ['order', 'position']}}

If I change the "def _auth(self)" and increase the expires variable the websocket return data correctly.
I thing that is a good idea implement the auto increase recv window like HTTP that work fine, because is very difficult to sync the timestamp. What do you think?

if s_json['ret_code'] == 10002:   
   error_msg += '. Added 2.5 seconds to recv_window'     
   recv_window += 2500

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions