- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经检查了很多问题和教程,我正在关注 socketme 门户的官方文档。我在 XAMPP/Localhost 上运行它。
当我不使用 WAMP 接口(interface)时,Websocket 可以工作。否则,它无法连接并且不说明任何原因。
错误是:“app.js:6200 WebSocket 连接到‘ws://localhost:8080/socket’失败:连接关闭无法访问”
服务器
$server = new \Ratchet\App('localhost', 8080);
$server->route('/socket', new WebSocketHandler, array('*'));
$server->run();
WebSocketHandler 是
WampServerInterface
的基本实现并且只包括抽象的方法,没有任何变化。
var connection = new Autobahn.Connection({
transports: [{
type: 'websocket',
port: 8080,
host: 'localhost',
url: 'ws://localhost:8080/socket'
}],
realm: 'realm1'
});
connection.onopen = function(session) {
app.content = app.content + `connected!`
};
connection.onclose = function(reason, details) {
app.content = app.content + `onclose!`
}
connection.open();
我在这个实现中做错了,但我想不通。我试过避免
->route
方法并使用以下 Vanilla 方法:
$server = IoServer::factory(
new HttpServer(
new WsServer(
new WampServer(
new WebSocketHandler()
)
)
),
8080
);
但是,它没有用。
最佳答案
您需要 Autobahn.js 0.8.2 才能将其连接到 Ratchet (WAMP v1),这是一个非常古老的实现,而且 ab 0.8.2 也非常古老。
您应该将您的工作导航到 Thruway。我尝试这样做,但找不到 Thruway RatcherRouter 的任何自定义实现(onMessage、onOpen 等),因此,我决定自己(非常糟糕)实现 Ratchet。
TL; DR:切换到高速公路。
关于php - Autobahn-js 无法连接到 Ratchet Server (Wamp),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68433313/
我最近发现 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 路由器发布消息。
我是一名优秀的程序员,十分优秀!