XMPP Component Protocol (XEP-0114) Library for Erlang
Running the demo component
Any server that supports XEP-0114 will do. For example, when initially developing this library, both ejabberd and openfire worked just fine.
Perform a basic installation and configuration of Openfire.
When logged in to the admin console, under the "Server" tab, under "Server Settings", there's an "External Components" option. Select that.
Enable the "External Components" service.
By default, the demo external component will use the following
settings to contact the main XMPP server. You can update the port
number and shared secret in the Openfire admin console, or override
the demo's defaults by editing the Makefile or supplying new values on
|Setting||Makefile variable||Default value|
|Hostname to connect to||
|Port number to connect to||
|Secret shared with server||
|XMPP domain of component||
DEMODOMAIN setting needs some explanation. If your XMPP server
is responsible for managing JIDs ending in
instance, then the extension should take responsibility for JIDs
@e.xmpp.example.com. There's no good way of determining
the correct JID domain, so by default we guess that it is exactly the
You will almost always need to supply
DEMODOMAIN unless you are
developing against a non-production XMPP server running on localhost.
To start the demo external component, make sure the XMPP server is
running, and run
make run. For example, to start the demo with
To start the demo, using port 5275 (Openfire's default) to contact the XMPP server,
make run DEMOPORT=5275
To start the demo component, making it claim responsibility for JIDs
make run DEMODOMAIN=e.xmpp.example.com
Interacting with the demo component
The demo component is not much more than a simple echo service.
Assuming it is configured to use JID domain
Try using service discovery on
Try chatting to any JID in
e.xmpp.example.com; for example,
Try adding any JID in the domain to your roster.
Copyright and license
Copyright (C) 2012, 2014 Tony Garnock-Jones <firstname.lastname@example.org> erlang-xmpp-component is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. erlang-xmpp-component is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with erlang-xmpp-component. If not, see <http://www.gnu.org/licenses/>.