简体   繁体   English

PubNub-曾经起作用但不再起作用的代码

[英]PubNub - Code that worked once but doesn't work anymore

A year and a half before, I used to test PubNub and I had a testcase that worked pretty well. 一年半以前,我曾经测试过PubNub,并且有一个很好用的测试用例。 Now, I'm trying to get back where I left to go on testing but, for a reason I don't get, I can't make my chatroom work anymore (demo account). 现在,我正尝试回到剩下的地方进行测试,但是由于我不明白的原因,我无法再继续进行聊天室(演示帐户)。

For your information, I use Punbub with socket.io and here is what's inside my html file: 供您参考,我将Punbub与socket.io一起使用,这是我的html文件中的内容:

<html>

    <head>

        .....

        <script src="http://cdn.pubnub.com/socket.io.min.js"></script>

    </head>

    <body>

        ....

        <script type="text/javascript"> 

            ....

            var pubnub_setup = 
            {
                user          : 'xxxx',
                channel       : 'shoutbox',
                publish_key   : 'pub-c-xxxxxxxxxxxxxxxxxxxxxxx',
                subscribe_key : 'sub-c-xxxxxxxxxxxxxxxxxxxxxxx'
            };

            var socket  = io.connect( 'http://pubsub.pubnub.com', pubnub_setup );

            ....

        </script>

    </body>

</html>

These keys are up to date (I created a brand new account) but nothing happens. 这些密钥是最新的(我创建了一个新帐户),但是没有任何反应。

If I open firebug, I have "Network Connection Errors" everywhere, each second. 如果我打开Firebug,则每秒都有“网络连接错误”。

Here is one of them: 这是其中之一:

"NetworkError: 403 Forbidden - http://ps12.pubnub.com/v2/presence/sub_key/sub-c-xxxxxxxxxxxxxxxxxxxxxxxx/channel/shoutbox?uuid=0&pnsdk=PubNub-JS-Web%2F3.6.7 " “NetworkError:403禁止- http://ps12.pubnub.com/v2/presence/sub_key/sub-c-xxxxxxxxxxxxxxxxxxxxxxxx/channel/shoutbox?uuid=0&pnsdk=PubNub-JS-Web%2F3.6.7

And If I use the demo interface of the Pubnub website with the same keys, I get a: 而且,如果我使用相同的键使用Pubnub网站的演示界面,则会得到:

"["SUBSCRIBE ERROR",{"message":"Forbidden","payload":{"channels":["shoutbox"]}}" “ [” SUBSCRIBE ERROR“,{” message“:” Forbidden“,” payload“:{” channels“:[” shoutbox“]}}”

Any help would be appreciated. 任何帮助,将不胜感激。

It looks like you are having PAM (security access) errors. 您似乎遇到了PAM(安全访问)错误。 Please contact us at support@pubnub.com so we can square you away with your security settings. 请通过support@pubnub.com与我们联系,以便我们为您提供安全设置。

geremy geremy

This typically means that you have enabled Access Manager on your account. 这通常意味着您已在帐户上启用Access Manager。 This immediately blocks all access to PubNub (using those keys) unless access has been granted. 除非已授予访问权限,否则这将立即阻止所有对PubNub的访问(使用这些键)。 To resolve this issue quickly, just disable Access Manager on your account until you are ready to implement Access Manager into your application (granting access using auth-keys). 要快速解决此问题,只需在您的帐户上禁用Access Manager,直到准备好在应用程序中实现Access Manager(使用auth-key授予访问权限)为止。

For more information on Access Manager, see the following links. 有关Access Manager的更多信息,请参见以下链接。

Grant Access: http://www.pubnub.com/docs/javascript/api/reference.html#grant 授予访问权限: http : //www.pubnub.com/docs/javascript/api/reference.html#grant

Read more about PAM: http://www.pubnub.com/how-it-works/access-manager/ 阅读有关PAM的更多信息: http : //www.pubnub.com/how-it-works/access-manager/

Security with PAM: http://www.pubnub.com/docs/javascript/overview/security.html PAM的安全性: http : //www.pubnub.com/docs/javascript/overview/security.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM