使用 Orbited、STOMP 和 MorbidQ 进行身份验证

发布于 2024-08-15 01:50:12 字数 193 浏览 5 评论 0原文

我正在使用 Orbited 在基于 PHP 的网站上构建 Comet 聊天系统。然而,目前任何用户都可以订阅或发布到任何频道。

我想做的是让浏览器直接监听来自 Orbited 服务器的更新,并让 PHP 身份验证层处理所有其他操作(订阅、发送),该身份验证层通过套接字与 Orbited 进行通信。有没有办法做到这一点,或者我是否需要一个更强大的消息队列?

I'm using Orbited to build a Comet chat system on a PHP-based website. However, currently any user can subscribe or post to any channel.

What I'm looking to do is have the browser listen for updates directly from the Orbited server, and have all other actions (subscribe, send) handled by a PHP authentication layer, which communicates with Orbited via sockets. Is there a way to do this, or am I going to need a more robust messaging queue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦魇绽荼蘼 2024-08-22 01:50:12

您可以让用户订阅各个频道。

通过 PHP 脚本(AJAX 调用)发布消息,这将:

  • 检查发件人是否经过身份验证
  • 将消息发布给经过身份验证的用户(迭代经过身份验证的用户列表并向每个用户发送消息)

如何从 PHP 发送 STOMP 消息?使用 PHP STOMP 客户端。

You can make the users subscribe to the individual channels.

Do the message posting through the PHP script (AJAX call), which will:

  • check if the sender is authenticated
  • post the message to the autenticated users (iterate over authenticated user list and send each user the message)

How to send the STOMP message from PHP? Use the PHP STOMP client.

浮萍、无处依 2024-08-22 01:50:12

如果您使用 MorbiQ,您应该查看 RestQ 插件 (http://www.morbidq. com/trac/wiki/RestQ)。

If you are using MorbiQ, you should check out the RestQ plugin (http://www.morbidq.com/trac/wiki/RestQ).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文