Websocket Token Design
When we use http, we normally place our token in header, since HTTP is stateless. This makes sense.
Howev开发者_开发问答er when it comes to WebSocket, I notice it is stateful. Should we still send it in every request, or just send it once, until some times has reached or server response expire, then we refresh the token and send it to server again?
I have found that public API expects us to send every request through WebSocket to include token, For example, in Deribit API
I do not understand the reason why token is needed for every request sent inside WebSocket. and Why such a design is made.
Can anyone explain to me, thanks.
精彩评论