strophe

Libstrophe wrapper

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version 0.12.1
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • Andrea Giusti

Installation

nimble install strophe
choosenim install strophe
git clone https://github.com/SillaIndustries/nim-strophe

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
strophe - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.12 No

Source

Repository https://github.com/SillaIndustries/nim-strophe
Homepage https://github.com/SillaIndustries/nim-strophe
Registry Source nimble_official

README

Nim libstrophe wrapper

Note: This wrapper was written with libstrophe 0.12.1. Older version may not work. Libstrophe documentation and examples can be found here: https://strophe.im/libstrophe/

Installation

nimble install strophe

Example

Smoke test

import strophe
const hostname = "127.0.0.1"
const port = 5222

let connHandler: xmppconnhandler = proc (a0: ptr xmppconnt, a1: xmppconneventt, a2: cint, a3: ptr xmppstreamerrort, a4: pointer): void {.cdecl.}=
    var ctx = cast[ptr xmppctxt](a4)
    if a1 == Xmppconnconnect:
        echo "Connected!"
    else:
        echo "Error!"
        xmppstop(ctx)

xmppinitialize()
var log = xmppgetdefaultlogger(Xmppleveldebug);
var ctx = xmppctxnew(nil, log)
var conn = xmppconnnew(ctx)

xmppconnsetjid(conn, "myjid")
if xmppconnectclient(conn, hostname, port, connHandler, ctx) == Xmppeok:
    xmpprun(ctx)

discard xmppconnrelease(conn)
xmppctxfree(ctx)
xmppshutdown()