简体   繁体   English

阻止RabbitMQ Web-stomp客户端发送

[英]Prevent RabbitMQ web-stomp client from sending

I have RabbitMQ + WebStomp. 我有RabbitMQ + WebStomp。 I would like totally restrict ability to send info to queue from JavaScript code. 我想完全限制从JavaScript代码发送信息到队列的能力。 Instead only server side should do this. 相反,只有服务器端才应该这样做。

In other words I would like allow following code: 换句话说,我想允许以下代码:

...
client.subscribe("/queue/My-One-Way-Queue", function(m) {
...
client.onreceive = function(message) {
    console.log(message);
}

And prevent malicious software to do following: 并防止恶意软件执行以下操作:

client.send('/queue/My-One-Way-Queue', 
    {'reply-to': '/temp-queue/My-One-Way-Queue'}, text);

You need to create a user for the JavaScript client that has read permissions only. 您需要为JavaScript客户端创建一个仅具有读取权限的用户。 See: https://www.rabbitmq.com/access-control.html 参见: https : //www.rabbitmq.com/access-control.html

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

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