Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Jul 17, 2018
1 parent ee022cb commit b31bae3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ RUN apk --no-cache upgrade && apk --no-cache add ca-certificates
COPY centrifugo /usr/local/bin/centrifugo

CMD ["centrifugo"]

4 changes: 4 additions & 0 deletions docs/content/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ No - Centrifugo is best-effort transport. This means that if you want strongly g

Centrifugo can keep message history for a while and you can want to rely on it for your needs. Centrifugo is not designed as data storage - it uses message history mostly for recovering missed messages after short client internet connection disconnects. It's not designed to be used to sync client state after being offline for a long time - this logic should be on your app backend.

### What is the difference between Centrifugo and Centrifuge

[Centrifugo](https://github.com/centrifugal/centrifugo) is server built on top of [Centrifuge](https://github.com/centrifugal/centrifuge) library for Go language.

### I have not found an answer on my question here:

We have [gitter chat room](https://gitter.im/centrifugal/centrifugo) - welcome!
7 changes: 5 additions & 2 deletions docs/content/misc/migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ Centrifugo v2 simplified communication with API - requests should not be signed

Centrifugo v1 could process messages published in Redis queue. In v2 this possibility was removed because this technique is not good in terms of error handling and non-deterministic delay before message will be processed by Centrifugo node worker. Migrate to using HTTP or GRPC API.

### Use JWT instead of hand-crafted token
### Use JWT instead of hand-crafted connection token

In Centrifugo v2 you must use JWT instead of hand-crafted tokens of v1. This means that you need to download JWT library for your language (there are plenty of them – see jwt.io) and build connection token with it.

See dedicated docs chapter to see how token can be built.

All connection information will be passed inside this single token string. This means you only need to pass one string to your frontend. No need to pass `user`, `timestamp`, `info` anymore. This also means that you will have less problems with escaping features of template engines - because JWT is safe base64 string.

###
### Use JWT instead of hand-crafted signature for private subscriptions

Read chapter about private subscriptions to find how you should now use JWT for private channel subscriptions.

2 changes: 1 addition & 1 deletion docs/content/server/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ The tip whether or not connection must be refreshed comes in reply to `connect`

When client connection expire mechanism is on the value of field `expires` in connect reply is `true`. In this case client implementation should look at `ttl` value which is seconds left until connection will be considered expired. Client must send `refresh` command after this `ttl` seconds. Server gives client a configured window to refresh token after `ttl` passed and then closes connection if client have not updated its token.

When connecting with already expired token an error will be returned (with code `110`). In this case client should refresh its token and reconnect with exponential backoff.
When connecting with already expired token an error will be returned (with code `109`). In this case client should refresh its token and reconnect with exponential backoff.

### RPC-like calls: publish, history, presence

Expand Down

0 comments on commit b31bae3

Please sign in to comment.