开发者

Configure Jabber external component to send stanza on behalf of any user [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this quest开发者_JAVA百科ion? Update the question so it's on-topic for Stack Overflow.

Closed 9 years ago.

Improve this question

I read somewhere a while ago that one can configure external jabber components (XEP-0114) to send XMPP stanza's on behalf on any user. For instance say i have a component bind to (component.localhost) and i want it to send a message stanza with "from" attribute set to "user@localhost".

I am trying to achieve this with ejabberd. Won't be surprised if I will have to hack down ejabberd src to get this working (if at all possible).


If you are using ejabberd, you can use the {service_check_from, false} option in your service definition to disable the verification on the "from" attribute.

Keep in mind, though, that XEP 0114 requires that the "host" part of the JIDs match the name of the component.

See the corresponding section of ejabberd documentation for all the gory details.


Technically, you have to actually write the component, but this can easily be done. You have first to confugre ejabberd so that it accepts connections on a specific for your component, with a given componet JID and a password. The default configuration file has several examples, for gateways for example.

Once this is done, connect an XMPP library/client with this component's credential and you should be good to go! The only constraint is that you send valid XML.


Your component will typically only be allowed to send stanzas appearing to be from *@component.domain.com, rather than @.domain.com. This is a security feature.

If you want this functionality, you may have to write a server plugin rather than an external component.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜