开发者

Websocket Token Design

开发者 https://www.devze.com 2022-12-07 23:32 出处:网络
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

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

Websocket Token Design

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消