Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add section about websocket authorization
  • Loading branch information
djpnewton authored Nov 1, 2017
1 parent 13104b2 commit c7f97ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ matchengine

[HTTP Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/HTTP-Protocol) and [Websocket Protocl](https://github.com/viabtc/viabtc_exchange_server/wiki/WebSocket-Protocol) documents are available in Chinese. Should time permit, we will have it translated into English in the future.

## Websocket authorization

The websocket protocol has an authorization method (`server.auth`) which is used to authorize the websocket connection to subscribe to user specific events (trade and balance events).

To accomodate this method your exchange frontend will need to supply an internal endpoint which takes an authorization token from the HTTP header named `Authorization` and validates that token and returns the user_id.

Example response: `{"code": 0, "message": null, "data": {"user_id": 1}}`

## Donation

* BTC: 14x3GrEoMLituT6vF2wcEbqMAxCvt2724s
Expand Down

0 comments on commit c7f97ce

Please sign in to comment.