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

Websocket auth request expired #37

Open
moranelli opened this issue May 29, 2021 · 2 comments
Open

Websocket auth request expired #37

moranelli opened this issue May 29, 2021 · 2 comments

Comments

@moranelli
Copy link

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
@ImaRicklePick
Copy link

#67 Started a PR on this issue

@dextertd
Copy link
Collaborator

@moranelli See #67 (comment) for why I am weary of "auto increase like recv window" for websocket, and I personally don't like the auto increase in HTTP...

Why is it "very difficult to sync the timestamp"? I think you can just sync your computer's clock, which is done differently depending on the OS.

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

No branches or pull requests

3 participants