如何使用给定的 From 或 ReplyTo 发送 XMPP 消息?
我想通过我的 Web 应用程序在两个用户 A 和 B 之间发起聊天。因此,我使用 Smack 客户端 API 或直接从 OpenFire 插件创建 XMPP 消息:
- 通过 Smack 从 A 向 B 发送消息
- 通过 Smack 从服务器向 B 发送带有回复的消息 A
XEP-0033 允许 OpenFire 支持“replyTo 地址”,但是IM 客户端不支持。
看来“from”不能被客户端或 OpenFire 插件覆盖。我还认为 GTalk 不会接受来自 [email protected] 的 xmpp 消息[电子邮件受保护] 通过 ServerToServer 协议。
还有其他方法可以做到这一点吗?我希望我的 Web 应用程序伪造从 UserA 到 UserB 的消息。但这个网络应用程序不是 A 或 B。
最好的问候, 日本人
I would like to initiate a Chat between two users A and B from my web application. So I create an XMPP Message using Smack Client API or directly from an OpenFire Plugin:
- Send a Message by Smack from A to B
- Send a Message by Smack from Server to B with replyTo A
XEP-0033 allow "replyTo address" supported by OpenFire but not suported by IM Clients.
It seems "from" can't be overrided by a client or an OpenFire plugin. I also think GTalk will not accept an xmpp message from [email protected] to [email protected] by ServerToServer protocol.
Is there an other way to do this ? I want my web application to forge a message from UserA to UserB. But this webapp is not A or B.
Best Regards,
Jp
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何 XMPP 服务器都应该忽略节中的发件人地址,并将从连接中获得的地址标记到它发送的节中。这是 XMPP 兼容服务器的一个特定功能,用于阻止地址欺骗和垃圾邮件等。您可能必须编辑服务器的源并更改其行为。但这很危险,如果您要与其他服务器联合,我不会推荐它。
J
Any XMPP server should ignore the from address in a stanza and stamp the one that it get's from the connection into the stanza it sends on. This is a specific feature of XMPP compliant servers and is used to stop address spoofing and spam etc. You'd probably have to edit the source of a server and change it's behaviour. This is dangerous though and I wouldn't reccomend it if you'll be federating with other servers.
J