0

据我了解 PrimePush 的工作方式,连接到服务器是通过客户端的 javascript 调用发生的。

我担心用户破解 javascript - 试图订阅他们无权访问的频道。

这就是为什么我正在寻找一种优雅的方式来拒绝 PrimePush 连接,如果我能够确定用户无权访问该频道(例如为另一个用户订阅消息)。

如果这可以通过@onOpen 方法实现,那就太好了。

4

1 回答 1

0

In the end I ended up registering users by a unique id (e.g. session id), so that no one could guess the id. Then I would just create logic for figuring out which sockets should receive information on which events. Not as elegant I think, but it should be rather safe.

于 2014-09-19T13:43:07.820 回答