Closed synw closed 7 years ago
You are passing timestamp generated on client side, it most probably differs from server side used to generate token, so just pass timestamp to template
That was it, thank you.
I can say that some example/bootstrap code can be useful as you noticed in another issue. I can make an example with the code above if you wish, now that it works, if you consider it correct.
@synw of course any example will help, especially for NodeJS and other languages/frameworks we have no examples at all, feel free to make pull requests to https://github.com/centrifugal/examples repo
In case anyone is running their Centrifugo instance from docker and are running on a MAC please be aware of this issue. https://forums.docker.com/t/time-in-container-is-out-of-sync/16566. basically the problem is your docker container's time will be out of Sync with your host machine which will give us an invalid token in our case. you can find the solution on that link above and on that thread or on the following link https://github.com/arunvelsriram/docker-time-sync-agent/.
@deresegetachew in addition I suppose that it should only affect Centrifugo users who have connection_lifetime
option enabled - in other cases Centrifugo does not rely on system timestamp value
Btw starting from Docker 17.05 issue with time difference was fixed - though it was not yet released as stable release.
Hi. I always get an
invalid token
response when I use this server library. I may have missed something. Here is the code:index.js
:views/index.ejs
:Tested with Centrifugo 1.7.1