Pubnub无效的时间戳

时间:2016-02-03 12:06:19

标签: pubnub ntp

每当我使用PAM并授予时,我总是从我的控制台获取此信息。

Object {message: "Invalid Timestamp"}

我已经将NTP设置为我的ubuntu服务器,但仍然没有任何变化。

我的pubnub补助金在这里:

 pubnub.grant({
  channel  : channel,
  callback : function (m) { console.log("grant success: ", m); },
  error    : function (m) { console.log("grant error: ", m); },
  ttl      : 5, // Minutes
  read     : true,
  write    : false,
  auth_key : 'auth_key_here'
 });

我的代码出了什么问题?谢谢你的帮助。

1 个答案:

答案 0 :(得分:0)

请按照给定的步骤为pubnub设置NTP服务器。

步骤1安装NTP

 $ sudo apt-get update
    $ sudo apt-get install ntp

步骤2编辑ntp.conf

Replace these four with pubnub server 



server 0.ubuntu.pool.ntp.org 
    server 1.ubuntu.pool.ntp.org 
    server 2.ubuntu.pool.ntp.org 
    server 3.ubuntu.pool.ntp.org 

    to

    server 0.pubsub.pubnub.com
    server 1.pubsub.pubnub.com
    server 2.pubsub.pubnub.com
    server 3.pubsub.pubnub.com

步骤3重启NTP服务

$ sudo service ntp restart