- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在继承 WampCraServerProtocol
(来自 Autobahn Python)并覆盖 getAuthSecret
。我知道现在我可以从那个方法返回一个延迟,但是,当做一个简单的测试时:
def getAuthSecret(self, authKey):
deferred = Deferred()
deferred.callback("secret")
return deferred
...我的 WampCraClientProtocol
出现以下错误:
身份验证错误! http://api.wamp.ws/error#generic Deferred 实例没有属性 '__len__' None
好吧,光是这一点就已经令人困惑了。 getAuthSecret
返回的 deferred 是否有特殊要求?
好的,继续,基于那个错误,我向我要返回的延迟添加了一个(简单的)len 方法:
def getAuthSecret(self, authKey):
#secret_deferred = self.factory.get_secret(authKey)
deferred = Deferred()
deferred.__len__ = lambda: 1
deferred.callback("secret")
return deferred
...在那种情况下,我得到:
Authentication Error! http://api.wamp.ws/error#generic unsupported operand type(s) for +: 'instance' and 'str' None
这让我更加困惑。我只想知道从该方法返回延迟的正确方法。(我应该注意到,如果返回一个简单的简单字符串,一切都会完美无缺)。谢谢。
最佳答案
这对我有用:
https://github.com/tavendo/AutobahnPython/blob/master/examples/wamp/authentication/server.py#L72
您使用的是哪个 AutobahnPython 版本?
更新:
v0.5.9 有一个关于基于延迟的身份验证的错误(见下面的评论)。它已在 v0.5.14 上修复。基于 Wamp Cra 延迟的身份验证在该版本上运行良好。
关于python - 使用 Autobahn Wamp Cra 时如何使用延迟返回身份验证密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15035213/
我最近发现 autobahn python 和 js 是建立 pub/sub 服务器和相应客户端的舒适方法,即使使用 rpc 调用也是如此。 看完教程后,我设置了一个测试版本,其中有一个 websoc
我正在使用 Ratchet 和 Autobahn.js。我想在订阅时进行一些用户验证,所以我需要将 session key 传递给 Ratchet WAMP 服务器。你能告诉我如何在订阅事件中将一些数
我有一个 Crossbar.js 实现,其中数据通过 Crossbar websocket 服务器在客户端(网站)和服务器(Node.js)之间发送。双方都使用 Autobahn.JS 连接到 Cro
我正在我们的客户和我们之间建立一个博客,以便他们可以有一个空间来讨论不同的商业交易(每笔商业交易都有一个引用号并有自己的信息)。 现在我可以使用 ZeroMQ 和 Autobahn 设置 Ratche
我正在使用 Autobahn Wamp 在 Python 中进行套接字连接。我正在使用 PubSub 机制来建立连接。连接建立成功。 但我找不到一种方法来维护与服务器连接的客户端列表。 任何人都可以建
我正在试验 Ratchet php library .特别是,我一直在尝试整合他们的 push integration演示到 React 应用程序中。 他们的演示引用 a seemingly one-
我正在使用下面的 JavaScript 代码连接到高速公路服务器。一直以来我都使用静态IP,但现在IP将是动态的。如何传递动态服务器 IP 并动态连接高速公路? var connection = ne
我正在研究 WebSockets atm,刚刚发现 Autobahn 带有 Autobahn|Python 。我不确定我是否正确理解该工具集(?)的功能。 我的目的是使用 WebSocket-Serv
我正在尝试为使用 Autobahn 的应用程序编写单元测试。 我想测试我的 Controller ,它从协议(protocol)中获取接收到的数据,解析它并对其使用react。 但是当我的测试到了应该
我目前正在尝试通过 Crossbar/Autobahn 使用 Websockets 实现用户通知系统。我已经完成了多项测试并阅读了文档,但是,我不确定是否有解决以下工作流程的方法: 用户使用网络应用程
我从 OpenCV VideoCapture.read() 捕获视频帧并将帧发送到 WebSocket 服务器(Twisted with Autobahn WebSocket API),我还使用 Tw
当使用 autobahn 进行 RPC 时,autobahn 支持返回 python 对象的过程,只要它们是 json 可序列化的。我想要返回的某些对象默认情况下不可 json 序列化。我可以轻松编写
是否可以运行(挂载在cherrypy树中)autobahnn的websocket类以在相同的端口但不同的URL上运行? 例如: http://localhost:8080/web服务器静态内容(htm
我喜欢 crossbar.io 及其工作方式(个人)。但我想知道如何使用 Autobahn(Crossbar.io) 为典型的动态聊天应用程序设置架构。 这里的动态聊天是指为每个 url 创建的单独聊
在 autobahnJS 的文档中提供以下示例来说明如何设置远程过程调用 (RPC): ... // 3) register a procedure for remoting functi
我在这里运行了这个例子:https://github.com/crossbario/crossbarexamples/tree/master/wss/python ,一切正常。 但是,以下情况对我不起
场景:1. 我有一个 ListView ,即时获取数据。由于滚动它可能获得的数据可能是陈旧的。 2. 当我使用线程实现 HTTP 客户端时,在滚动时我会取消所有请求 threadHandler.rem
我想重写我的 WebSocketClientFactory 类以允许传入数据填充作业队列。这是我正在尝试的连接代码 factory = WebSocketClientFactory("ws:/
我正在继承 WampCraServerProtocol(来自 Autobahn Python)并覆盖 getAuthSecret。我知道现在我可以从那个方法返回一个延迟,但是,当做一个简单的测试时:
我正在尝试将 aiohttp 网络服务器集成到 Crossbar+Autobahn 系统架构中。 更详细地说,当aiohttp 服务器收到某个API 调用时,它必须向Crossbar 路由器发布消息。
我是一名优秀的程序员,十分优秀!