Natter is an XMPP erlang library. It currently only supports IQ stanzas and has no support for messages, roster, and just enough presence support to be able to connect.
autoreconf --install ./configure make sudo make install
This will install natter at: /usr/local/lib/erlang/lib/
autoreconf --install ./configure --prefix=/usr/ make sudo make install
This will install natter at: /usr/lib/erlang/lib/
Config = [{host, "localhost"}, {user, "foo"}, {password, "bar"}, {resource, "foobar"}]. {ok, Cn} = natter_connection:start_link(Config).
An exchange routes packets to interested processes. A process can tell natter that he is interested in hearing all messages that come in (default_exchange) or that he is interested in hearing messages that go to a particular JID.
Config = [{host, "localhost"}, {user, "foo"}, {password, "bar"}, {resource, "foobar"}]. {ok, Cn} = natter_connection:start_link(Config). natter_connection:register_default_exchange(self(), Cn).
Config = [{host, "localhost"}, {user, "foo"}, {password, "bar"}, {resource, "foobar"}]. {ok, Cn} = natter_connection:start_link(Config). natter_connection:register_exchange(Cn, "iq", "bar@localhost", self()).
3 main modules:
-
natter_connection: public API. Runs as a supervisor.
-
natter_packetizer: responsible for dealing with all network traffic. Reads in incoming XML and finds out when you have a complete packet. It then sends the packet to the dispatcher.
-
natter_dispatcher: figures out where packets should go.
XML Parsing is done using an erlang wrapper around libexpat. Inspired by Jabberlang. Faster than xmerl.
XML is parsed into a tuple:
{xmlelement, “iq”, Attrs, Subels}
-
Move away from plain-text authentication
-
Support for presence
-
Support for message stanzas
-
Support for rosters