Php 用于ActiveMQ+;网袋

Php 用于ActiveMQ+;网袋,php,websocket,activemq,stomp,Php,Websocket,Activemq,Stomp,我已经安装了带有WebSocket支持的ActiveMQ,并且能够让JS演示正常工作。我现在面临的问题是PHP Stomp库不能与WebSocket URI一起使用,因此当我尝试时: $stomp = new Stomp('ws://localhost:61614'); 我得到: $stomp = new Stomp('ws://localhost:61614'); 连接失败:代理URI方案无效 $stomp = new Stomp('ws://localhost:61614'); 关于如

我已经安装了带有WebSocket支持的ActiveMQ,并且能够让JS演示正常工作。我现在面临的问题是PHP Stomp库不能与WebSocket URI一起使用,因此当我尝试时:

$stomp = new Stomp('ws://localhost:61614');
我得到:

$stomp = new Stomp('ws://localhost:61614');
连接失败:代理URI方案无效

$stomp = new Stomp('ws://localhost:61614');
关于如何通过PHP发送消息,有什么想法吗?我是从错误的角度看这个问题吗。我是否应该尝试使用常规PHP套接字函数连接到ActiveMQ

$stomp = new Stomp('ws://localhost:61614');

谢谢。

是的,您应该通过PHP通过TCP连接到消息队列。在内部,这将使用PHP的套接字或流套接字,但您应该能够简单地正常使用STOMP库

$stomp = new Stomp('ws://localhost:61614');
例如:

$stomp = new Stomp('ws://localhost:61614');
$stomp = new Stomp('tcp://localhost:61613');
您需要确保在ActiveMQ中启用了常规STOMP

$stomp = new Stomp('ws://localhost:61614');