Skip to content

chrisyunker/xcl

Repository files navigation

XCL

Build Status

XCL (XMPP Client Library) is a client XMPP library implemented in Erlang.

Building

XCL is a rebar-compatible OTP application. It depends on the following libraries:

To build run make or use rebar tool.

Usage

Create a properly list with the following configured arguments:

Args = [{username, "username"},
        {password, "password1"},
        {domain, "yunker.io"},
        {resource, "xcl"},
        {host, "yunker.io"},
        {port, 5223},
        {transport, socket | ws},
        {auth, plain},
        {tls, none | tls | starttls},
        {compress, none}]

Start session:

{ok, Session} = xcl_session:start(Args)

Send a stanza:

ok = xcl_session:send_stanza(Session, Xmlel)

Receive a stanza:

{ok, Xmlel} = xcl_session:receive_stanza(Session)

Check if session is valid:

true | false = xcl_session:is_valid(Session)

Stop session:

ok = xcl_session:stop(Session)